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_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 10 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // by the compositor and is only valid between InitializeHwDraw and | 84 // by the compositor and is only valid between InitializeHwDraw and |
85 // ReleaseHwDraw. | 85 // ReleaseHwDraw. |
86 virtual gpu::GLInProcessContext* GetShareContext() = 0; | 86 virtual gpu::GLInProcessContext* GetShareContext() = 0; |
87 | 87 |
88 // "On demand" hardware draw. The content is first clipped to |damage_area|, | 88 // "On demand" hardware draw. The content is first clipped to |damage_area|, |
89 // then transformed through |transform|, and finally clipped to |view_size|. | 89 // then transformed through |transform|, and finally clipped to |view_size|. |
90 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 90 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
91 gfx::Size surface_size, | 91 gfx::Size surface_size, |
92 const gfx::Transform& transform, | 92 const gfx::Transform& transform, |
93 gfx::Rect viewport, | 93 gfx::Rect viewport, |
94 gfx::Rect clip) = 0; | 94 gfx::Rect clip, |
| 95 gfx::Rect viewport_rect_for_tile_priority, |
| 96 const gfx::Transform& transform_for_tile_priority) = 0; |
95 | 97 |
96 // For delegated rendering, return resources from parent compositor to this. | 98 // For delegated rendering, return resources from parent compositor to this. |
97 // Note that all resources must be returned before ReleaseHwDraw. | 99 // Note that all resources must be returned before ReleaseHwDraw. |
98 virtual void ReturnResources(const cc::CompositorFrameAck& frame_ack) = 0; | 100 virtual void ReturnResources(const cc::CompositorFrameAck& frame_ack) = 0; |
99 | 101 |
100 // "On demand" SW draw, into the supplied canvas (observing the transform | 102 // "On demand" SW draw, into the supplied canvas (observing the transform |
101 // and clip set there-in). | 103 // and clip set there-in). |
102 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; | 104 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; |
103 | 105 |
104 // Set the memory limit policy of this compositor. | 106 // Set the memory limit policy of this compositor. |
105 virtual void SetMemoryPolicy( | 107 virtual void SetMemoryPolicy( |
106 const SynchronousCompositorMemoryPolicy& policy) = 0; | 108 const SynchronousCompositorMemoryPolicy& policy) = 0; |
107 | 109 |
108 // Should be called by the embedder after the embedder had modified the | 110 // Should be called by the embedder after the embedder had modified the |
109 // scroll offset of the root layer (as returned by | 111 // scroll offset of the root layer (as returned by |
110 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). | 112 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). |
111 virtual void DidChangeRootLayerScrollOffset() = 0; | 113 virtual void DidChangeRootLayerScrollOffset() = 0; |
112 | 114 |
113 protected: | 115 protected: |
114 virtual ~SynchronousCompositor() {} | 116 virtual ~SynchronousCompositor() {} |
115 }; | 117 }; |
116 | 118 |
117 } // namespace content | 119 } // namespace content |
118 | 120 |
119 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 121 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |