| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // OutputSurface. | 66 // OutputSurface. |
| 67 bool BindToClient(cc::OutputSurfaceClient* surface_client) override; | 67 bool BindToClient(cc::OutputSurfaceClient* surface_client) override; |
| 68 void DetachFromClient() override; | 68 void DetachFromClient() override; |
| 69 void Reshape(const gfx::Size& size, float scale_factor) override; | 69 void Reshape(const gfx::Size& size, float scale_factor) override; |
| 70 void SwapBuffers(cc::CompositorFrame* frame) override; | 70 void SwapBuffers(cc::CompositorFrame* frame) override; |
| 71 void Invalidate() override; | 71 void Invalidate() override; |
| 72 | 72 |
| 73 // Partial SynchronousCompositor API implementation. | 73 // Partial SynchronousCompositor API implementation. |
| 74 scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 74 scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| 75 gfx::Size surface_size, | 75 const gfx::Size& surface_size, |
| 76 const gfx::Transform& transform, | 76 const gfx::Transform& transform, |
| 77 gfx::Rect viewport, | 77 const gfx::Rect& viewport, |
| 78 gfx::Rect clip, | 78 const gfx::Rect& clip, |
| 79 gfx::Rect viewport_rect_for_tile_priority, | 79 const gfx::Rect& viewport_rect_for_tile_priority, |
| 80 const gfx::Transform& transform_for_tile_priority); | 80 const gfx::Transform& transform_for_tile_priority); |
| 81 void ReturnResources(const cc::CompositorFrameAck& frame_ack); | 81 void ReturnResources(const cc::CompositorFrameAck& frame_ack); |
| 82 scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas); | 82 scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas); |
| 83 void SetMemoryPolicy(size_t bytes_limit); | 83 void SetMemoryPolicy(size_t bytes_limit); |
| 84 void SetTreeActivationCallback(const base::Closure& callback); | 84 void SetTreeActivationCallback(const base::Closure& callback); |
| 85 void GetMessagesToDeliver(ScopedVector<IPC::Message>* messages); | 85 void GetMessagesToDeliver(ScopedVector<IPC::Message>* messages); |
| 86 | 86 |
| 87 size_t GetMemoryPolicy() const { | 87 size_t GetMemoryPolicy() const { |
| 88 return memory_policy_.bytes_limit_when_visible; | 88 return memory_policy_.bytes_limit_when_visible; |
| 89 } | 89 } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 class SoftwareDevice; | 92 class SoftwareDevice; |
| 93 friend class SoftwareDevice; | 93 friend class SoftwareDevice; |
| 94 | 94 |
| 95 void InvokeComposite(const gfx::Transform& transform, | 95 void InvokeComposite(const gfx::Transform& transform, |
| 96 gfx::Rect viewport, | 96 const gfx::Rect& viewport, |
| 97 gfx::Rect clip, | 97 const gfx::Rect& clip, |
| 98 gfx::Rect viewport_rect_for_tile_priority, | 98 const gfx::Rect& viewport_rect_for_tile_priority, |
| 99 gfx::Transform transform_for_tile_priority, | 99 const gfx::Transform& transform_for_tile_priority, |
| 100 bool hardware_draw); | 100 bool hardware_draw); |
| 101 bool CalledOnValidThread() const; | 101 bool CalledOnValidThread() const; |
| 102 | 102 |
| 103 const int routing_id_; | 103 const int routing_id_; |
| 104 SynchronousCompositorRegistry* const registry_; // unowned | 104 SynchronousCompositorRegistry* const registry_; // unowned |
| 105 bool registered_; | 105 bool registered_; |
| 106 | 106 |
| 107 // Not owned. | 107 // Not owned. |
| 108 SynchronousCompositorOutputSurfaceClient* sync_client_; | 108 SynchronousCompositorOutputSurfaceClient* sync_client_; |
| 109 | 109 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 124 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; | 124 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
| 125 | 125 |
| 126 base::ThreadChecker thread_checker_; | 126 base::ThreadChecker thread_checker_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); | 128 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace content | 131 } // namespace content |
| 132 | 132 |
| 133 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 133 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |