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

Unified Diff: services/gles2/command_buffer_driver.cc

Issue 1343513002: When rendering offscreen, prefer size 0 instead of 1. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: review feedback Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gles2/command_buffer_driver.cc
diff --git a/services/gles2/command_buffer_driver.cc b/services/gles2/command_buffer_driver.cc
index 6ba980f01fc3b7ca8047bf088ec6e4ce1b891fe1..4720bf695165357f9b0dd7746131ccd36acc9950 100644
--- a/services/gles2/command_buffer_driver.cc
+++ b/services/gles2/command_buffer_driver.cc
@@ -99,10 +99,17 @@ void CommandBufferDriver::Initialize(
bool CommandBufferDriver::DoInitialize(
mojo::ScopedSharedBufferHandle shared_state) {
- if (widget_ == gfx::kNullAcceleratedWidget)
+ if (widget_ == gfx::kNullAcceleratedWidget) {
+ // This is a dummy surface, so attempt to skip actual surface
+ // allocation by passing size 0.
surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
- gfx::Size(1, 1), requested_configuration_);
- else {
+ gfx::Size(0, 0), requested_configuration_);
+ if (!surface_.get()) {
+ // If size 0 was a fail, retry with size 1.
+ surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
+ gfx::Size(1, 1), requested_configuration_);
+ }
+ } else {
surface_ =
gfx::GLSurface::CreateViewGLSurface(widget_, requested_configuration_);
if (auto vsync_provider = surface_->GetVSyncProvider()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698