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

Unified Diff: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc

Issue 571623003: Partial swap implementation for surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
index a1e7f54a117e103294fa4a0217e1d53a4983b881..b0c78661a2eb19c3bbe8cfe02d0229b70d370579 100644
--- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
@@ -21,13 +21,15 @@ GpuSurfacelessBrowserCompositorOutputSurface::
IDMap<BrowserCompositorOutputSurface>* output_surface_map,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator,
+ GLHelper* gl_helper,
unsigned internalformat)
: GpuBrowserCompositorOutputSurface(context,
surface_id,
output_surface_map,
vsync_manager,
overlay_candidate_validator.Pass()),
- internalformat_(internalformat) {
+ internalformat_(internalformat),
+ gl_helper_(gl_helper) {
}
GpuSurfacelessBrowserCompositorOutputSurface::
@@ -38,6 +40,11 @@ void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
cc::CompositorFrame* frame) {
DCHECK(output_surface_);
+ output_surface_->SwapBuffers(frame->gl_frame_data->sub_buffer_rect);
+ // Disable the sub-buffer processing path on the parent classes, because we
+ // have handled it here.
+ frame->gl_frame_data->sub_buffer_rect = gfx::Rect(frame->gl_frame_data->size);
+
const gfx::Size& size = frame->gl_frame_data->size;
context_provider_->ContextGL()->ScheduleOverlayPlaneCHROMIUM(
0,
@@ -51,7 +58,6 @@ void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
0,
1.0f,
1.0f);
- output_surface_->SwapBuffers();
GpuBrowserCompositorOutputSurface::SwapBuffers(frame);
}
@@ -78,7 +84,8 @@ bool GpuSurfacelessBrowserCompositorOutputSurface::BindToClient(
cc::OutputSurfaceClient* client) {
if (!GpuBrowserCompositorOutputSurface::BindToClient(client))
return false;
- output_surface_.reset(new BufferQueue(context_provider_, internalformat_));
+ output_surface_.reset(
+ new BufferQueue(context_provider_, gl_helper_, internalformat_));
return output_surface_->Initialize();
}

Powered by Google App Engine
This is Rietveld 408576698