Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: android_webview/browser/aw_render_thread_context_provider.cc

Issue 1441273002: Android WebView: Crash on compositor context loss (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/browser/parent_output_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/aw_render_thread_context_provider.h" 5 #include "android_webview/browser/aw_render_thread_context_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 blink::WebGraphicsContext3D::Attributes attributes; 53 blink::WebGraphicsContext3D::Attributes attributes;
54 attributes.antialias = false; 54 attributes.antialias = false;
55 attributes.depth = false; 55 attributes.depth = false;
56 attributes.stencil = false; 56 attributes.stencil = false;
57 attributes.shareResources = true; 57 attributes.shareResources = true;
58 attributes.noAutomaticFlushes = true; 58 attributes.noAutomaticFlushes = true;
59 gpu::gles2::ContextCreationAttribHelper attribs_for_gles2; 59 gpu::gles2::ContextCreationAttribHelper attribs_for_gles2;
60 gpu_blink::WebGraphicsContext3DImpl::ConvertAttributes(attributes, 60 gpu_blink::WebGraphicsContext3DImpl::ConvertAttributes(attributes,
61 &attribs_for_gles2); 61 &attribs_for_gles2);
62 attribs_for_gles2.lose_context_when_out_of_memory = true; 62 attribs_for_gles2.lose_context_when_out_of_memory = false;
63 63
64 context_.reset(gpu::GLInProcessContext::Create( 64 context_.reset(gpu::GLInProcessContext::Create(
65 service, 65 service,
66 surface, 66 surface,
67 surface->IsOffscreen(), 67 surface->IsOffscreen(),
68 gfx::kNullAcceleratedWidget, 68 gfx::kNullAcceleratedWidget,
69 surface->GetSize(), 69 surface->GetSize(),
70 NULL /* share_context */, 70 NULL /* share_context */,
71 false /* share_resources */, 71 false /* share_resources */,
72 attribs_for_gles2, 72 attribs_for_gles2,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 void AwRenderThreadContextProvider::OnLostContext() { 174 void AwRenderThreadContextProvider::OnLostContext() {
175 DCHECK(main_thread_checker_.CalledOnValidThread()); 175 DCHECK(main_thread_checker_.CalledOnValidThread());
176 176
177 if (!lost_context_callback_.is_null()) 177 if (!lost_context_callback_.is_null())
178 base::ResetAndReturn(&lost_context_callback_).Run(); 178 base::ResetAndReturn(&lost_context_callback_).Run();
179 if (gr_context_) 179 if (gr_context_)
180 gr_context_->abandonContext(); 180 gr_context_->abandonContext();
181 } 181 }
182 182
183 } // namespace android_webview 183 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/parent_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698