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_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // OutputSurface. | 67 // OutputSurface. |
68 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; | 68 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; |
69 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; | 69 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; |
70 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; | 70 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; |
71 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; | 71 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
72 | 72 |
73 // Partial SynchronousCompositor API implementation. | 73 // Partial SynchronousCompositor API implementation. |
74 bool InitializeHwDraw( | 74 bool InitializeHwDraw( |
75 scoped_refptr<cc::ContextProvider> onscreen_context_provider); | 75 scoped_refptr<cc::ContextProvider> onscreen_context_provider); |
76 void ReleaseHwDraw(); | 76 void ReleaseHwDraw(); |
77 scoped_ptr<cc::CompositorFrame> DemandDrawHw(gfx::Size surface_size, | 77 scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
78 const gfx::Transform& transform, | 78 gfx::Size surface_size, |
79 gfx::Rect viewport, | 79 const gfx::Transform& transform, |
80 gfx::Rect clip); | 80 gfx::Rect viewport, |
| 81 gfx::Rect clip, |
| 82 gfx::Rect viewport_rect_for_tile_priority, |
| 83 const gfx::Transform& transform_for_tile_priority); |
81 void ReturnResources(const cc::CompositorFrameAck& frame_ack); | 84 void ReturnResources(const cc::CompositorFrameAck& frame_ack); |
82 scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas); | 85 scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas); |
83 void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy); | 86 void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy); |
84 void GetMessagesToDeliver(ScopedVector<IPC::Message>* messages); | 87 void GetMessagesToDeliver(ScopedVector<IPC::Message>* messages); |
85 | 88 |
86 private: | 89 private: |
87 class SoftwareDevice; | 90 class SoftwareDevice; |
88 friend class SoftwareDevice; | 91 friend class SoftwareDevice; |
89 | 92 |
90 void InvokeComposite(const gfx::Transform& transform, | 93 void InvokeComposite(const gfx::Transform& transform, |
91 gfx::Rect viewport, | 94 gfx::Rect viewport, |
92 gfx::Rect clip, | 95 gfx::Rect clip, |
| 96 gfx::Rect viewport_rect_for_tile_priority, |
| 97 gfx::Transform transform_for_tile_priority, |
93 bool hardware_draw); | 98 bool hardware_draw); |
94 bool CalledOnValidThread() const; | 99 bool CalledOnValidThread() const; |
95 SynchronousCompositorOutputSurfaceDelegate* GetDelegate(); | 100 SynchronousCompositorOutputSurfaceDelegate* GetDelegate(); |
96 | 101 |
97 int routing_id_; | 102 int routing_id_; |
98 bool needs_begin_frame_; | 103 bool needs_begin_frame_; |
99 bool invoking_composite_; | 104 bool invoking_composite_; |
100 | 105 |
101 gfx::Transform cached_hw_transform_; | 106 gfx::Transform cached_hw_transform_; |
102 gfx::Rect cached_hw_viewport_; | 107 gfx::Rect cached_hw_viewport_; |
103 gfx::Rect cached_hw_clip_; | 108 gfx::Rect cached_hw_clip_; |
| 109 gfx::Rect cached_hw_viewport_rect_for_tile_priority_; |
| 110 gfx::Transform cached_hw_transform_for_tile_priority_; |
104 | 111 |
105 // Only valid (non-NULL) during a DemandDrawSw() call. | 112 // Only valid (non-NULL) during a DemandDrawSw() call. |
106 SkCanvas* current_sw_canvas_; | 113 SkCanvas* current_sw_canvas_; |
107 | 114 |
108 cc::ManagedMemoryPolicy memory_policy_; | 115 cc::ManagedMemoryPolicy memory_policy_; |
109 | 116 |
110 cc::OutputSurfaceClient* output_surface_client_; | 117 cc::OutputSurfaceClient* output_surface_client_; |
111 scoped_ptr<cc::CompositorFrame> frame_holder_; | 118 scoped_ptr<cc::CompositorFrame> frame_holder_; |
112 | 119 |
113 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; | 120 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
114 | 121 |
115 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); | 122 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); |
116 }; | 123 }; |
117 | 124 |
118 } // namespace content | 125 } // namespace content |
119 | 126 |
120 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF
ACE_H_ | 127 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF
ACE_H_ |
OLD | NEW |