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

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

Issue 2443003004: cc: Make OutputSurface::BindToClient pure virtual and not return bool (Closed)
Patch Set: bindtoclient-pure-virtual: rebase Created 4 years, 2 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_browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
index b5accf78982f71294d212db3d808311b999ee013..5043c54d2b825ec4786770ba0adc1eec4f042b3d 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -30,7 +30,12 @@ GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
std::move(vsync_manager),
begin_frame_source,
std::move(overlay_candidate_validator)),
- weak_ptr_factory_(this) {}
+ weak_ptr_factory_(this) {
+ if (capabilities_.uses_default_gl_framebuffer) {
+ capabilities_.flipped_output_surface =
+ context_provider()->ContextCapabilities().flips_vertically;
+ }
+}
GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() =
default;
@@ -52,15 +57,11 @@ void GpuBrowserCompositorOutputSurface::OnReflectorChanged() {
}
}
-bool GpuBrowserCompositorOutputSurface::BindToClient(
+void GpuBrowserCompositorOutputSurface::BindToClient(
cc::OutputSurfaceClient* client) {
- if (!BrowserCompositorOutputSurface::BindToClient(client))
- return false;
-
- if (capabilities_.uses_default_gl_framebuffer) {
- capabilities_.flipped_output_surface =
- context_provider()->ContextCapabilities().flips_vertically;
- }
+ DCHECK(client);
+ DCHECK(!client_);
+ client_ = client;
GetCommandBufferProxy()->SetSwapBuffersCompletionCallback(
base::Bind(&GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted,
@@ -68,7 +69,6 @@ bool GpuBrowserCompositorOutputSurface::BindToClient(
GetCommandBufferProxy()->SetUpdateVSyncParametersCallback(base::Bind(
&GpuBrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu,
weak_ptr_factory_.GetWeakPtr()));
- return true;
}
void GpuBrowserCompositorOutputSurface::EnsureBackbuffer() {}

Powered by Google App Engine
This is Rietveld 408576698