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

Unified Diff: content/renderer/render_widget.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 | « content/renderer/render_widget.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 21f19c262c5ba3c72aad53945d6d370b738790c7..4cdae0478d9d6254d52379cd0c2edd39c7b72159 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -919,25 +919,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
scoped_refptr<ContextProviderCommandBuffer> context_provider;
if (!use_software) {
- // Explicitly disable antialiasing for the compositor. As of the time of
- // this writing, the only platform that supported antialiasing for the
- // compositor was Mac OS X, because the on-screen OpenGL context creation
- // code paths on Windows and Linux didn't yet have multisampling support.
- // Mac OS X essentially always behaves as though it's rendering offscreen.
- // Multisampling has a heavy cost especially on devices with relatively low
- // fill rate like most notebooks, and the Mac implementation would need to
- // be optimized to resolve directly into the IOSurface shared between the
- // GPU and browser processes. For these reasons and to avoid platform
- // disparities we explicitly disable antialiasing.
- blink::WebGraphicsContext3D::Attributes attributes;
- attributes.antialias = false;
- attributes.shareResources = true;
- attributes.noAutomaticFlushes = true;
- attributes.depth = false;
- attributes.stencil = false;
context_provider = ContextProviderCommandBuffer::Create(
- CreateGraphicsContext3D(attributes),
- "RenderCompositor");
+ CreateGraphicsContext3D(), "RenderCompositor");
if (!context_provider.get()) {
// Cause the compositor to wait and try again.
return scoped_ptr<cc::OutputSurface>();
@@ -2842,8 +2825,7 @@ bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const {
}
scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
-RenderWidget::CreateGraphicsContext3D(
- const blink::WebGraphicsContext3D::Attributes& attributes) {
+RenderWidget::CreateGraphicsContext3D() {
if (!webwidget_)
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -2858,6 +2840,24 @@ RenderWidget::CreateGraphicsContext3D(
if (!gpu_channel_host)
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
+ // Explicitly disable antialiasing for the compositor. As of the time of
+ // this writing, the only platform that supported antialiasing for the
+ // compositor was Mac OS X, because the on-screen OpenGL context creation
+ // code paths on Windows and Linux didn't yet have multisampling support.
+ // Mac OS X essentially always behaves as though it's rendering offscreen.
+ // Multisampling has a heavy cost especially on devices with relatively low
+ // fill rate like most notebooks, and the Mac implementation would need to
+ // be optimized to resolve directly into the IOSurface shared between the
+ // GPU and browser processes. For these reasons and to avoid platform
+ // disparities we explicitly disable antialiasing.
+ blink::WebGraphicsContext3D::Attributes attributes;
+ attributes.antialias = false;
+ attributes.shareResources = true;
+ attributes.noAutomaticFlushes = true;
+ attributes.depth = false;
+ attributes.stencil = false;
+ bool bind_generates_resources = false;
+ bool lose_context_when_out_of_memory = true;
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
#if defined(OS_ANDROID)
// If we raster too fast we become upload bound, and pending
@@ -2883,14 +2883,14 @@ RenderWidget::CreateGraphicsContext3D(
#endif
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
- new WebGraphicsContext3DCommandBufferImpl(
- surface_id(),
- GetURLForGraphicsContext3D(),
- gpu_channel_host.get(),
- attributes,
- false /* bind generates resources */,
- limits,
- NULL));
+ new WebGraphicsContext3DCommandBufferImpl(surface_id(),
+ GetURLForGraphicsContext3D(),
+ gpu_channel_host.get(),
+ attributes,
+ bind_generates_resources,
+ lose_context_when_out_of_memory,
+ limits,
+ NULL));
return context.Pass();
}
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698