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

Unified Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 15875009: Refactor SynchronousCompositor out of SynchronousCompositorOutputSurface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase mistake Created 7 years, 7 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 | « content/renderer/android/synchronous_compositor_output_surface.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/android/synchronous_compositor_output_surface.cc
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
index 8b06c1fce65a619f37916df42381373dbf3908e5..f8db0549a861f7760cdac587bf8fb32f6aa5456b 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -87,12 +87,11 @@ class SynchronousCompositorOutputSurface::SoftwareDevice
};
SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
- int32 routing_id)
- : cc::OutputSurface(CreateWebGraphicsContext3D(),
- scoped_ptr<cc::SoftwareOutputDevice>(
- new SoftwareDevice(this))),
- compositor_client_(NULL),
- routing_id_(routing_id),
+ SynchronousCompositorOutputSurfaceDelegate* delegate)
+ : cc::OutputSurface(
+ CreateWebGraphicsContext3D(),
+ scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
+ delegate_(delegate),
needs_begin_frame_(false),
did_swap_buffer_(false),
current_sw_canvas_(NULL) {
@@ -101,8 +100,7 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
DCHECK(CalledOnValidThread());
- if (compositor_client_)
- compositor_client_->DidDestroyCompositor(this);
+ delegate_->DidDestroySynchronousOutputSurface();
}
bool SynchronousCompositorOutputSurface::ForcedDrawToSoftwareDevice() const {
@@ -114,8 +112,7 @@ bool SynchronousCompositorOutputSurface::BindToClient(
DCHECK(CalledOnValidThread());
if (!cc::OutputSurface::BindToClient(surface_client))
return false;
- GetContentClient()->renderer()->DidCreateSynchronousCompositor(routing_id_,
- this);
+ delegate_->DidCreateSynchronousOutputSurface();
return true;
}
@@ -134,7 +131,7 @@ void SynchronousCompositorOutputSurface::SetNeedsBeginFrame(
bool enable) {
DCHECK(CalledOnValidThread());
needs_begin_frame_ = enable;
- UpdateCompositorClientSettings();
+ delegate_->SetContinuousInvalidate(needs_begin_frame_);
}
void SynchronousCompositorOutputSurface::SwapBuffers(
@@ -143,13 +140,6 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
did_swap_buffer_ = true;
}
-void SynchronousCompositorOutputSurface::SetClient(
- SynchronousCompositorClient* compositor_client) {
- DCHECK(CalledOnValidThread());
- compositor_client_ = compositor_client;
- UpdateCompositorClientSettings();
-}
-
bool SynchronousCompositorOutputSurface::IsHwReady() {
return context3d() != NULL;
}
@@ -202,12 +192,6 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
client_->BeginFrame(base::TimeTicks::Now());
}
-void SynchronousCompositorOutputSurface::UpdateCompositorClientSettings() {
- if (compositor_client_) {
- compositor_client_->SetContinuousInvalidate(needs_begin_frame_);
- }
-}
-
// Not using base::NonThreadSafe as we want to enforce a more exacting threading
// requirement: SynchronousCompositorOutputSurface() must only be used by
// embedders that supply their own compositor loop via
« no previous file with comments | « content/renderer/android/synchronous_compositor_output_surface.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698