diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 01:40:30 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 01:40:30 +0000 |
commit | 6820d79c2f8a865afdd48e51ea67691ebb7db816 (patch) | |
tree | 0fe808bc93d4faf22ae75c763cd8e55c6e032f35 /cc/output/output_surface.h | |
parent | 875b7f7f612335372e4dfc0493d18d5df3b5c45a (diff) | |
download | chromium_src-6820d79c2f8a865afdd48e51ea67691ebb7db816.zip chromium_src-6820d79c2f8a865afdd48e51ea67691ebb7db816.tar.gz chromium_src-6820d79c2f8a865afdd48e51ea67691ebb7db816.tar.bz2 |
Revert 206020 "cc: Emulate BeginFrame in OutputSurfaces that don..."
This is causing pre-rendered pages to not load on android: crbug.com/249806
> cc: Emulate BeginFrame in OutputSurfaces that don't support it natively
>
> This includes two small fixes for the original version of this
> patch that broke software compositing and WebView.
>
> This will allow us to avoid having two different code paths
> in the Scheduler. It also allows us to more easily remove the
> VSyncTimeSource and FrameRateController from the Scheduler.
>
> This patch instantiates the FrameRateController inside of
> OutputSurface for now, but the FrameRateController could be
> removed in future patches.
>
> BUG=245920
> BUG=243497
> TBR=nduca@chromium.org,sievers@chromium.org,kbr@chromium.org
>
> Review URL: https://chromiumcodereview.appspot.com/16833003
TBR=brianderson@chromium.org
Review URL: https://codereview.chromium.org/17204002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/output_surface.h')
-rw-r--r-- | cc/output/output_surface.h | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h index 8f782d7..d263d3a 100644 --- a/cc/output/output_surface.h +++ b/cc/output/output_surface.h @@ -12,7 +12,6 @@ #include "cc/base/cc_export.h" #include "cc/output/context_provider.h" #include "cc/output/software_output_device.h" -#include "cc/scheduler/frame_rate_controller.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" namespace ui { struct LatencyInfo; } @@ -20,16 +19,13 @@ namespace ui { struct LatencyInfo; } namespace gfx { class Rect; class Size; -class Transform; } namespace cc { class CompositorFrame; -class CompositorFrameAck; class OutputSurfaceClient; class OutputSurfaceCallbacks; -class Thread; // Represents the output surface for a compositor. The compositor owns // and manages its destruction. Its lifetime is: @@ -38,7 +34,7 @@ class Thread; // From here on, it will only be used on the compositor thread. // 3. If the 3D context is lost, then the compositor will delete the output // surface (on the compositor thread) and go back to step 1. -class CC_EXPORT OutputSurface : public FrameRateControllerClient { +class CC_EXPORT OutputSurface { public: explicit OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); @@ -87,13 +83,6 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { // thread. virtual bool BindToClient(OutputSurfaceClient* client); - void InitializeBeginFrameEmulation( - Thread* thread, - bool throttle_frame_production, - base::TimeDelta interval); - - void SetMaxFramesPending(int max_frames_pending); - virtual void EnsureBackbuffer(); virtual void DiscardBackbuffer(); @@ -114,7 +103,7 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { // Requests a BeginFrame notification from the output surface. The // notification will be delivered by calling // OutputSurfaceClient::BeginFrame until the callback is disabled. - virtual void SetNeedsBeginFrame(bool enable); + virtual void SetNeedsBeginFrame(bool enable) {} protected: // Synchronously initialize context3d and enter hardware mode. @@ -127,6 +116,7 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { void PostSwapBuffersComplete(); + OutputSurfaceClient* client_; struct cc::OutputSurface::Capabilities capabilities_; scoped_ptr<OutputSurfaceCallbacks> callbacks_; scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; @@ -135,34 +125,12 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { bool has_swap_buffers_complete_callback_; gfx::Size surface_size_; float device_scale_factor_; - base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; - - // The FrameRateController is deprecated. - // Platforms should move to native BeginFrames instead. - void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval); - virtual void FrameRateControllerTick(bool throttled) OVERRIDE; - scoped_ptr<FrameRateController> frame_rate_controller_; - int max_frames_pending_; - int pending_swap_buffers_; - bool begin_frame_pending_; - - // Forwarded to OutputSurfaceClient but threaded through OutputSurface - // first so OutputSurface has a chance to update the FrameRateController - bool HasClient() { return !!client_; } - void SetNeedsRedrawRect(gfx::Rect damage_rect); - void BeginFrame(base::TimeTicks frame_time); - void DidSwapBuffers(); - void OnSwapBuffersComplete(const CompositorFrameAck* ack); - void DidLoseOutputSurface(); - void SetExternalDrawConstraints(const gfx::Transform& transform, - gfx::Rect viewport); private: - OutputSurfaceClient* client_; - friend class OutputSurfaceCallbacks; - void SetContext3D(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); + void SwapBuffersComplete(); + + base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(OutputSurface); }; |