Commit 96177551 authored by kylechar's avatar kylechar Committed by Commit Bot

Reland "Remove unnecessary Flush() in ~GLInProcessContext()."

This reverts commit 1ff7430b.

Reason for revert: Revert didn't fix the problem.

Original change's description:
> Revert "Remove unnecessary Flush() in ~GLInProcessContext()."
> 
> This reverts commit d6ce677a.
> 
> Reason for revert: 
> 
> It looks like this caused Asan bot failures: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/28394
> 
> See the details at crbug.com/867786
> 
> Original change's description:
> > Remove unnecessary Flush() in ~GLInProcessContext().
> > 
> > ~GLES2Implementation() already calls Finish(), so remove the redundant
> > Flush(). This should avoid allocating memory just to send the flush
> > command with OOP-D.
> > 
> > Bug: 866486
> > Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
> > Change-Id: Ia8513920e2f0d65e89b0213310e6477d732ca08a
> > Reviewed-on: https://chromium-review.googlesource.com/1150662
> > Commit-Queue: kylechar <kylechar@chromium.org>
> > Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#578078}
> 
> TBR=sunnyps@chromium.org,kylechar@chromium.org
> 
> Change-Id: Iceeec3fc7e1807363583fb80df89642c99907a4d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 866486
> Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
> Reviewed-on: https://chromium-review.googlesource.com/1150062
> Reviewed-by: Hajime Hoshi <hajimehoshi@chromium.org>
> Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#578227}

TBR=hajimehoshi@chromium.org,sunnyps@chromium.org,kylechar@chromium.org

Change-Id: Ib0a8a8caf06b97088cf9e7781f941a9ba181d2c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 866486
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1150543Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578286}
parent 48f84c49
......@@ -34,22 +34,7 @@ namespace gpu {
GLInProcessContext::GLInProcessContext() = default;
GLInProcessContext::~GLInProcessContext() {
if (gles2_implementation_) {
// First flush the context to ensure that any pending frees of resources
// are completed. Otherwise, if this context is part of a share group,
// those resources might leak. Also, any remaining side effects of commands
// issued on this context might not be visible to other contexts in the
// share group.
gles2_implementation_->Flush();
gles2_implementation_.reset();
}
transfer_buffer_.reset();
gles2_helper_.reset();
command_buffer_.reset();
}
GLInProcessContext::~GLInProcessContext() = default;
const Capabilities& GLInProcessContext::GetCapabilities() const {
return command_buffer_->GetCapabilities();
......
......@@ -66,10 +66,11 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
const InProcessCommandBuffer::UpdateVSyncParametersCallback& callback);
private:
// The destruction order is important, don't reorder these member variables.
std::unique_ptr<InProcessCommandBuffer> command_buffer_;
std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_;
std::unique_ptr<TransferBuffer> transfer_buffer_;
std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_;
std::unique_ptr<InProcessCommandBuffer> command_buffer_;
DISALLOW_COPY_AND_ASSIGN(GLInProcessContext);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment