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

Unified Diff: content/browser/android/in_process/synchronous_compositor_output_surface.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/android/in_process/synchronous_compositor_output_surface.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
index 1c87cc34dac38c65d67940bf7ef9c3a583b07bfc..2438d65db7fb878969dfe4aa4b0a8c2d05a70b8e 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
@@ -6,11 +6,11 @@
#include "base/auto_reset.h"
#include "base/logging.h"
-#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/context_provider.h"
#include "cc/output/output_surface_client.h"
#include "cc/output/software_output_device.h"
+#include "content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.h"
#include "content/browser/android/in_process/synchronous_compositor_impl.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/public/browser/browser_thread.h"
@@ -76,8 +76,6 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
: cc::OutputSurface(
scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
routing_id_(routing_id),
- needs_begin_frame_(false),
- invoking_composite_(false),
current_sw_canvas_(NULL),
memory_policy_(0),
output_surface_client_(NULL),
@@ -124,14 +122,6 @@ void SynchronousCompositorOutputSurface::Reshape(
// Intentional no-op: surface size is controlled by the embedder.
}
-void SynchronousCompositorOutputSurface::SetNeedsBeginFrame(bool enable) {
- DCHECK(CalledOnValidThread());
- needs_begin_frame_ = enable;
- SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate();
- if (delegate && !invoking_composite_)
- delegate->SetContinuousInvalidate(needs_begin_frame_);
-}
-
void SynchronousCompositorOutputSurface::SwapBuffers(
cc::CompositorFrame* frame) {
DCHECK(CalledOnValidThread());
@@ -223,9 +213,8 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
gfx::Rect viewport_rect_for_tile_priority,
gfx::Transform transform_for_tile_priority,
bool hardware_draw) {
- DCHECK(!invoking_composite_);
DCHECK(!frame_holder_.get());
- base::AutoReset<bool> invoking_composite_resetter(&invoking_composite_, true);
+ DCHECK(begin_frame_source_);
gfx::Transform adjusted_transform = transform;
AdjustTransform(&adjusted_transform, viewport);
@@ -236,7 +225,8 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
transform_for_tile_priority,
!hardware_draw);
SetNeedsRedrawRect(gfx::Rect(viewport.size()));
- client_->BeginFrame(cc::BeginFrameArgs::CreateForSynchronousCompositor());
+
+ begin_frame_source_->BeginFrame();
// After software draws (which might move the viewport arbitrarily), restore
// the previous hardware viewport to allow CC's tile manager to prioritize
@@ -260,10 +250,6 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
if (frame_holder_.get())
client_->DidSwapBuffersComplete();
-
- SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate();
- if (delegate)
- delegate->SetContinuousInvalidate(needs_begin_frame_);
}
void SynchronousCompositorOutputSurface::ReturnResources(

Powered by Google App Engine
This is Rietveld 408576698