Chromium Code Reviews| Index: cc/output/output_surface.h |
| diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h |
| index 8904ac19bea56373561178480347da7587c9ef16..4925def3e259008bb203707f3bd6150d25d9dc71 100644 |
| --- a/cc/output/output_surface.h |
| +++ b/cc/output/output_surface.h |
| @@ -13,10 +13,10 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "cc/base/cc_export.h" |
| #include "cc/base/rolling_time_delta_history.h" |
| +#include "cc/output/begin_frame_args.h" |
| #include "cc/output/context_provider.h" |
| #include "cc/output/overlay_candidate_validator.h" |
| #include "cc/output/software_output_device.h" |
| -#include "cc/scheduler/frame_rate_controller.h" |
| namespace base { class SingleThreadTaskRunner; } |
| @@ -42,7 +42,7 @@ class OutputSurfaceClient; |
| // 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: |
| enum { |
| DEFAULT_MAX_FRAMES_PENDING = 2 |
| @@ -108,9 +108,6 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { |
| // Enable or disable vsync. |
| void SetThrottleFrameProduction(bool enable); |
| - void InitializeBeginFrameEmulation(base::SingleThreadTaskRunner* task_runner, |
| - base::TimeDelta interval); |
| - |
| virtual void EnsureBackbuffer(); |
| virtual void DiscardBackbuffer(); |
| @@ -131,7 +128,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) {} |
| bool HasClient() { return !!client_; } |
| @@ -145,6 +142,12 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { |
| } |
| protected: |
| + // Note: DidSwapBuffers and OnSwapBuffersComplete should not be called on |
|
danakj
2014/04/11 15:42:22
In browser process land we've avoided doing things
brianderson
2014/04/11 20:21:28
The id check works for making sure that an Ack for
danakj
2014/04/14 18:19:27
What if we reset the acks in flight and stuff when
brianderson
2014/04/16 21:51:31
Going to go with that solution and avoid being ove
|
| + // the client when the OutputSurface is lost to avoid race conditions where |
| + // DidSwapBuffersComplete gets registered for an incorrect OutputSurface. |
| + OutputSurfaceClient* client_; |
| + bool is_lost_; |
| + |
| // Synchronously initialize context3d and enter hardware mode. |
| // This can only supported in threaded compositing mode. |
| // |offscreen_context_provider| should match what is returned by |
| @@ -162,29 +165,11 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { |
| scoped_ptr<OverlayCandidateValidator> overlay_candidate_validator_; |
| gfx::Size surface_size_; |
| float device_scale_factor_; |
| - base::TimeDelta begin_frame_interval_; |
| - // The FrameRateController is deprecated. |
| - // Platforms should move to native BeginFrames instead. |
| void CommitVSyncParameters(base::TimeTicks timebase, |
| base::TimeDelta interval); |
| - virtual void FrameRateControllerTick(const BeginFrameArgs& args) OVERRIDE; |
| - scoped_ptr<FrameRateController> frame_rate_controller_; |
| - bool throttle_frame_production_; |
| - bool needs_begin_frame_; |
| - bool client_ready_for_begin_frame_; |
| - |
| - // This stores a BeginFrame that we couldn't process immediately, |
| - // but might process retroactively in the near future. |
| - BeginFrameArgs skipped_begin_frame_args_; |
| - |
| - // Forwarded to OutputSurfaceClient but threaded through OutputSurface |
| - // first so OutputSurface has a chance to update the FrameRateController |
| void SetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| - void BeginFrame(const BeginFrameArgs& args); |
| - void DidSwapBuffers(); |
| - void OnSwapBuffersComplete(); |
| void ReclaimResources(const CompositorFrameAck* ack); |
| void DidLoseOutputSurface(); |
| void SetExternalStencilTest(bool enabled); |
| @@ -193,24 +178,12 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { |
| const gfx::Rect& clip, |
| bool valid_for_tile_management); |
| - // virtual for testing. |
| - virtual base::TimeTicks RetroactiveBeginFrameDeadline(); |
| - virtual void PostCheckForRetroactiveBeginFrame(); |
| - void CheckForRetroactiveBeginFrame(); |
| - |
| private: |
| - OutputSurfaceClient* client_; |
| - |
| void SetUpContext3d(); |
| void ResetContext3d(); |
| void SetMemoryPolicy(const ManagedMemoryPolicy& policy); |
| void UpdateAndMeasureGpuLatency(); |
| - |
| - bool is_lost_; |
| - |
| - // check_for_retroactive_begin_frame_pending_ is used to avoid posting |
| - // redundant checks for a retroactive BeginFrame. |
| - bool check_for_retroactive_begin_frame_pending_; |
| + void OnSwapBuffersComplete(); |
| bool external_stencil_test_enabled_; |