Chromium Code Reviews| 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" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 struct ManagedMemoryPolicy; | 23 struct ManagedMemoryPolicy; |
| 24 | 24 |
| 25 class CC_EXPORT OutputSurfaceClient { | 25 class CC_EXPORT OutputSurfaceClient { |
| 26 public: | 26 public: |
| 27 // Called to synchronously re-initialize using the Context3D. Upon returning | 27 // Called to synchronously re-initialize using the Context3D. Upon returning |
| 28 // the compositor should be able to draw using GL what was previously | 28 // the compositor should be able to draw using GL what was previously |
| 29 // committed. | 29 // committed. |
| 30 virtual bool DeferredInitialize( | 30 virtual bool DeferredInitialize( |
| 31 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; | 31 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; |
| 32 virtual void ReleaseGL() = 0; | 32 virtual void ReleaseGL() = 0; |
| 33 virtual void CommitVSyncParameters(base::TimeTicks timebase, | |
| 34 base::TimeDelta interval) = 0; | |
| 33 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; | 35 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; |
| 34 virtual void BeginFrame(const BeginFrameArgs& args) = 0; | 36 virtual void BeginFrame(const BeginFrameArgs& args) = 0; |
| 37 // DidSwapBuffers and OnSwapBuffersComplete should not be called | |
| 38 // when the OutputSurface is lost to avoid race conditions in the scheduler | |
| 39 // if OnSwapBuffersComplete arrives for the previous OutputSurface. | |
|
Sami
2014/04/08 13:46:01
It feels like this comment belongs to OutputSurfac
brianderson
2014/04/09 02:52:05
Sounds good.
brianderson
2014/04/10 23:45:58
Done.
| |
| 35 virtual void DidSwapBuffers() = 0; | 40 virtual void DidSwapBuffers() = 0; |
| 36 virtual void OnSwapBuffersComplete() = 0; | 41 virtual void OnSwapBuffersComplete() = 0; |
| 37 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; | 42 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; |
| 38 virtual void DidLoseOutputSurface() = 0; | 43 virtual void DidLoseOutputSurface() = 0; |
| 39 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, | 44 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, |
| 40 const gfx::Rect& viewport, | 45 const gfx::Rect& viewport, |
| 41 const gfx::Rect& clip, | 46 const gfx::Rect& clip, |
| 42 bool valid_for_tile_management) = 0; | 47 bool valid_for_tile_management) = 0; |
| 43 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; | 48 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; |
| 44 // If set, |callback| will be called subsequent to each new tree activation, | 49 // If set, |callback| will be called subsequent to each new tree activation, |
| 45 // regardless of the compositor visibility or damage. |callback| must remain | 50 // regardless of the compositor visibility or damage. |callback| must remain |
| 46 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- | 51 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- |
| 47 // use SetTreeActivationCallback(base::Closure()) to unregister it. | 52 // use SetTreeActivationCallback(base::Closure()) to unregister it. |
| 48 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; | 53 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; |
| 49 | 54 |
| 50 protected: | 55 protected: |
| 51 virtual ~OutputSurfaceClient() {} | 56 virtual ~OutputSurfaceClient() {} |
| 52 }; | 57 }; |
| 53 | 58 |
| 54 } // namespace cc | 59 } // namespace cc |
| 55 | 60 |
| 56 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ | 61 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ |
| OLD | NEW |