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

Unified Diff: ui/compositor/test/in_process_context_factory.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: benchmark Created 6 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/ppb_graphics_3d_shared.cc ('k') | webkit/common/gpu/context_provider_in_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/test/in_process_context_factory.cc
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index ce83286f993264f7d6c44c8e2091d4fa4051d917..e49ea5162033aa4a498b5c5514c86386106d9821 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -29,11 +29,12 @@ scoped_ptr<cc::OutputSurface> InProcessContextFactory::CreateOutputSurface(
attrs.stencil = false;
attrs.antialias = false;
attrs.shareResources = true;
+ bool lose_context_when_out_of_memory = true;
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d(
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext(
- attrs, compositor->widget()));
+ attrs, lose_context_when_out_of_memory, compositor->widget()));
CHECK(context3d);
using webkit::gpu::ContextProviderInProcess;
@@ -56,8 +57,10 @@ scoped_refptr<cc::ContextProvider>
InProcessContextFactory::OffscreenCompositorContextProvider() {
if (!offscreen_compositor_contexts_.get() ||
!offscreen_compositor_contexts_->DestroyedOnMainThread()) {
+ bool lose_context_when_out_of_memory = true;
offscreen_compositor_contexts_ =
- webkit::gpu::ContextProviderInProcess::CreateOffscreen();
+ webkit::gpu::ContextProviderInProcess::CreateOffscreen(
+ lose_context_when_out_of_memory);
}
return offscreen_compositor_contexts_;
}
@@ -69,8 +72,10 @@ InProcessContextFactory::SharedMainThreadContextProvider() {
return shared_main_thread_contexts_;
if (ui::Compositor::WasInitializedWithThread()) {
+ bool lose_context_when_out_of_memory = false;
shared_main_thread_contexts_ =
- webkit::gpu::ContextProviderInProcess::CreateOffscreen();
+ webkit::gpu::ContextProviderInProcess::CreateOffscreen(
+ lose_context_when_out_of_memory);
} else {
shared_main_thread_contexts_ =
static_cast<webkit::gpu::ContextProviderInProcess*>(
« no previous file with comments | « ppapi/shared_impl/ppb_graphics_3d_shared.cc ('k') | webkit/common/gpu/context_provider_in_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698