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

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: 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..8d0e0a67df599bfdcc94758d1e7fda061a22bf95 100644
--- a/services/gles2/command_buffer_driver.cc
+++ b/services/gles2/command_buffer_driver.cc
@@ -99,10 +99,15 @@ 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(0, 0), requested_configuration_);
+ if (!surface_)
jamesr 2015/09/11 21:34:59 add { }s since the body of this conditional is mul
cdotstout 2015/09/11 21:52:54 Done.
+ surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
gfx::Size(1, 1), requested_configuration_);
jamesr 2015/09/11 21:34:59 i think indentation is now wrong on this line
cdotstout 2015/09/11 21:52:54 Done.
- else {
+ } 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