| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 class FrameSwapMessageQueue; | 36 class FrameSwapMessageQueue; |
| 37 class SynchronousCompositorRegistry; | 37 class SynchronousCompositorRegistry; |
| 38 class WebGraphicsContext3DCommandBufferImpl; | 38 class WebGraphicsContext3DCommandBufferImpl; |
| 39 | 39 |
| 40 class SynchronousCompositorOutputSurfaceClient { | 40 class SynchronousCompositorOutputSurfaceClient { |
| 41 public: | 41 public: |
| 42 virtual void DidActivatePendingTree() = 0; | 42 virtual void DidActivatePendingTree() = 0; |
| 43 virtual void Invalidate() = 0; | 43 virtual void Invalidate() = 0; |
| 44 virtual void SwapBuffers(uint32_t output_surface_id, | 44 virtual void SwapBuffers(uint32_t output_surface_id, |
| 45 cc::CompositorFrame* frame) = 0; | 45 cc::CompositorFrame frame) = 0; |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 virtual ~SynchronousCompositorOutputSurfaceClient() {} | 48 virtual ~SynchronousCompositorOutputSurfaceClient() {} |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Specialization of the output surface that adapts it to implement the | 51 // Specialization of the output surface that adapts it to implement the |
| 52 // content::SynchronousCompositor public API. This class effects an "inversion | 52 // content::SynchronousCompositor public API. This class effects an "inversion |
| 53 // of control" - enabling drawing to be orchestrated by the embedding | 53 // of control" - enabling drawing to be orchestrated by the embedding |
| 54 // layer, instead of driven by the compositor internals - hence it holds two | 54 // layer, instead of driven by the compositor internals - hence it holds two |
| 55 // 'client' pointers (|client_| in the OutputSurface baseclass and | 55 // 'client' pointers (|client_| in the OutputSurface baseclass and |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 | 70 |
| 71 void SetSyncClient(SynchronousCompositorOutputSurfaceClient* compositor); | 71 void SetSyncClient(SynchronousCompositorOutputSurfaceClient* compositor); |
| 72 bool OnMessageReceived(const IPC::Message& message); | 72 bool OnMessageReceived(const IPC::Message& message); |
| 73 | 73 |
| 74 // OutputSurface. | 74 // OutputSurface. |
| 75 bool BindToClient(cc::OutputSurfaceClient* surface_client) override; | 75 bool BindToClient(cc::OutputSurfaceClient* surface_client) override; |
| 76 void DetachFromClient() override; | 76 void DetachFromClient() override; |
| 77 void Reshape(const gfx::Size& size, | 77 void Reshape(const gfx::Size& size, |
| 78 float scale_factor, | 78 float scale_factor, |
| 79 bool has_alpha) override; | 79 bool has_alpha) override; |
| 80 void SwapBuffers(cc::CompositorFrame* frame) override; | 80 void SwapBuffers(cc::CompositorFrame frame) override; |
| 81 void Invalidate() override; | 81 void Invalidate() override; |
| 82 void BindFramebuffer() override; | 82 void BindFramebuffer() override; |
| 83 uint32_t GetFramebufferCopyTextureFormat() override; | 83 uint32_t GetFramebufferCopyTextureFormat() override; |
| 84 | 84 |
| 85 // Partial SynchronousCompositor API implementation. | 85 // Partial SynchronousCompositor API implementation. |
| 86 void DemandDrawHw(const gfx::Size& surface_size, | 86 void DemandDrawHw(const gfx::Size& surface_size, |
| 87 const gfx::Transform& transform, | 87 const gfx::Transform& transform, |
| 88 const gfx::Rect& viewport, | 88 const gfx::Rect& viewport, |
| 89 const gfx::Rect& clip, | 89 const gfx::Rect& clip, |
| 90 const gfx::Rect& viewport_rect_for_tile_priority, | 90 const gfx::Rect& viewport_rect_for_tile_priority, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool fallback_tick_running_; | 133 bool fallback_tick_running_; |
| 134 | 134 |
| 135 base::ThreadChecker thread_checker_; | 135 base::ThreadChecker thread_checker_; |
| 136 | 136 |
| 137 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); | 137 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| 141 | 141 |
| 142 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 142 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |