| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ | 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ |
| 6 #define CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ | 6 #define CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "cc/base/cc_export.h" | |
| 12 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 14 | 13 |
| 15 namespace gfx { | 14 namespace gfx { |
| 16 class Transform; | 15 class Transform; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace cc { | 18 namespace cc { |
| 20 | 19 |
| 21 class CompositorFrameAck; | 20 class CompositorFrameAck; |
| 22 struct ManagedMemoryPolicy; | |
| 23 | 21 |
| 24 class CC_EXPORT OutputSurfaceClient { | 22 class OutputSurfaceClient { |
| 25 public: | 23 public: |
| 26 // Called to synchronously re-initialize using the Context3D. Upon returning | 24 // Called to synchronously re-initialize using the Context3D. Upon returning |
| 27 // the compositor should be able to draw using GL what was previously | 25 // the compositor should be able to draw using GL what was previously |
| 28 // committed. | 26 // committed. |
| 29 virtual void DeferredInitialize() = 0; | 27 virtual void DeferredInitialize() = 0; |
| 30 // Must call OutputSurface::ReleaseContextProvider inside this call. | 28 // Must call OutputSurface::ReleaseContextProvider inside this call. |
| 31 virtual void ReleaseGL() = 0; | 29 virtual void ReleaseGL() = 0; |
| 32 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 30 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
| 33 base::TimeDelta interval) = 0; | 31 base::TimeDelta interval) = 0; |
| 34 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; | 32 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; |
| 35 virtual void DidSwapBuffers() = 0; | 33 virtual void DidSwapBuffers() = 0; |
| 36 virtual void DidSwapBuffersComplete() = 0; | 34 virtual void DidSwapBuffersComplete() = 0; |
| 37 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; | 35 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; |
| 38 virtual void DidLoseOutputSurface() = 0; | 36 virtual void DidLoseOutputSurface() = 0; |
| 39 virtual void SetExternalDrawConstraints( | 37 virtual void SetExternalDrawConstraints( |
| 40 const gfx::Transform& transform, | 38 const gfx::Transform& transform, |
| 41 const gfx::Rect& viewport, | 39 const gfx::Rect& viewport, |
| 42 const gfx::Rect& clip, | 40 const gfx::Rect& clip, |
| 43 const gfx::Rect& viewport_rect_for_tile_priority, | 41 const gfx::Rect& viewport_rect_for_tile_priority, |
| 44 const gfx::Transform& transform_for_tile_priority, | 42 const gfx::Transform& transform_for_tile_priority, |
| 45 bool resourceless_software_draw) = 0; | 43 bool resourceless_software_draw) = 0; |
| 46 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; | |
| 47 // If set, |callback| will be called subsequent to each new tree activation, | 44 // If set, |callback| will be called subsequent to each new tree activation, |
| 48 // regardless of the compositor visibility or damage. |callback| must remain | 45 // regardless of the compositor visibility or damage. |callback| must remain |
| 49 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- | 46 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- |
| 50 // use SetTreeActivationCallback(base::Closure()) to unregister it. | 47 // use SetTreeActivationCallback(base::Closure()) to unregister it. |
| 51 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; | 48 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; |
| 52 | 49 |
| 53 protected: | 50 protected: |
| 54 virtual ~OutputSurfaceClient() {} | 51 virtual ~OutputSurfaceClient() {} |
| 55 }; | 52 }; |
| 56 | 53 |
| 57 } // namespace cc | 54 } // namespace cc |
| 58 | 55 |
| 59 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ | 56 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ |
| OLD | NEW |