| Index: cc/output/output_surface.h
|
| diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h
|
| index d6f4b82ed8b64d9a9d81a87d52a5b0552746c852..0d1ad90e6df2a8a1112dc6ef189e36998d63f7d5 100644
|
| --- a/cc/output/output_surface.h
|
| +++ b/cc/output/output_surface.h
|
| @@ -9,6 +9,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "cc/base/cc_export.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; }
|
| @@ -21,8 +22,10 @@ class Size;
|
| 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:
|
| @@ -31,7 +34,7 @@ class OutputSurfaceCallbacks;
|
| // 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 {
|
| +class CC_EXPORT OutputSurface : public FrameRateControllerClient {
|
| public:
|
| explicit OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d);
|
|
|
| @@ -80,6 +83,14 @@ class CC_EXPORT OutputSurface {
|
| // thread.
|
| virtual bool BindToClient(OutputSurfaceClient* client);
|
|
|
| + void InitializeBeginFrameEmulation(
|
| + Thread* thread,
|
| + bool throttle_frame_production,
|
| + base::TimeDelta interval,
|
| + bool swap_buffers_complete_supported);
|
| +
|
| + void SetMaxFramesPending(int max_frames_pending);
|
| +
|
| // Sends frame data to the parent compositor. This should only be called when
|
| // capabilities().has_parent_compositor. The implementation may destroy or
|
| // steal the contents of the CompositorFrame passed in.
|
| @@ -102,10 +113,13 @@ class CC_EXPORT OutputSurface {
|
| // 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:
|
| + private:
|
| OutputSurfaceClient* client_;
|
| + friend class OutputSurfaceCallbacks;
|
| +
|
| + protected:
|
| struct cc::OutputSurface::Capabilities capabilities_;
|
| scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
|
| scoped_ptr<cc::SoftwareOutputDevice> software_device_;
|
| @@ -113,7 +127,26 @@ class CC_EXPORT OutputSurface {
|
|
|
| scoped_ptr<OutputSurfaceCallbacks> callbacks_;
|
|
|
| - private:
|
| + // 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 OnSendFrameToParentCompositorAck(const CompositorFrameAck&);
|
| + void DidSwapBuffers();
|
| + void OnSwapBuffersComplete();
|
| + void DidLoseOutputSurface();
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(OutputSurface);
|
| };
|
|
|
|
|