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

Unified Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: Fix copyright notice on new files Created 3 years, 11 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 | « gpu/ipc/in_process_command_buffer.cc ('k') | gpu/ipc/service/image_transport_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_command_buffer_stub.cc
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index e480daa44694ebf2feecffc46528cbfb257a86ab..3f41a30555095398eacb3ddab053551bfa5bfb3d 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -587,7 +587,7 @@ bool GpuCommandBufferStub::Initialize(
// only a single context. See crbug.com/510243 for details.
use_virtualized_gl_context_ |= channel_->mailbox_manager()->UsesSync();
- gl::GLSurface::Format surface_format = gl::GLSurface::SURFACE_DEFAULT;
+ gl::GLSurfaceFormat surface_format = gl::GLSurfaceFormat();
bool offscreen = (surface_handle_ == kNullSurfaceHandle);
gl::GLSurface* default_surface = manager->GetDefaultOffscreenSurface();
if (!default_surface) {
@@ -599,10 +599,12 @@ bool GpuCommandBufferStub::Initialize(
init_params.attribs.green_size <= 6 &&
init_params.attribs.blue_size <= 5 &&
init_params.attribs.alpha_size == 0)
- surface_format = gl::GLSurface::SURFACE_RGB565;
+ surface_format.SetRGB565();
+ // TODO(klausw): explicitly copy rgba sizes?
+
// We can only use virtualized contexts for onscreen command buffers if their
// config is compatible with the offscreen ones - otherwise MakeCurrent fails.
- if (surface_format != default_surface->GetFormat() && !offscreen)
+ if (!surface_format.IsCompatible(default_surface->GetFormat()) && !offscreen)
use_virtualized_gl_context_ = false;
#endif
« no previous file with comments | « gpu/ipc/in_process_command_buffer.cc ('k') | gpu/ipc/service/image_transport_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698