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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::unique_ptr<Frame> frame_; | 74 std::unique_ptr<Frame> frame_; |
75 #if DCHECK_IS_ON() | 75 #if DCHECK_IS_ON() |
76 bool waited_ = false; | 76 bool waited_ = false; |
77 #endif | 77 #endif |
78 }; | 78 }; |
79 | 79 |
80 // "On demand" hardware draw. Parameters are used by compositor for this draw. | 80 // "On demand" hardware draw. Parameters are used by compositor for this draw. |
81 // |viewport_size| is the current size to improve results during resize. | 81 // |viewport_size| is the current size to improve results during resize. |
82 // |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are | 82 // |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are |
83 // used to customize the tiling decisions of compositor. | 83 // used to customize the tiling decisions of compositor. |
84 virtual Frame DemandDrawHw( | 84 // TODO(ojars): update this and the next documentation |
| 85 virtual SynchronousCompositor::Frame DemandDrawHw( |
85 const gfx::Size& viewport_size, | 86 const gfx::Size& viewport_size, |
86 const gfx::Rect& viewport_rect_for_tile_priority, | 87 const gfx::Rect& viewport_rect_for_tile_priority, |
87 const gfx::Transform& transform_for_tile_priority) = 0; | 88 const gfx::Transform& transform_for_tile_priority) = 0; |
88 | 89 |
89 // Same as DemandDrawHw, but uses asynchronous IPC messages. Calls | 90 // Same as DemandDrawHw, but uses asynchronous IPC messages. Calls |
90 // SynchronousCompositorClient::OnDrawHardwareProcessFrame to return the | 91 // SynchronousCompositorClient::OnDrawHardwareProcessFrame to return the |
91 // frame. | 92 // frame. |
92 virtual void DemandDrawHwAsync( | 93 virtual scoped_refptr<SynchronousCompositor::FrameFuture> DemandDrawHwAsync( |
93 const gfx::Size& viewport_size, | 94 const gfx::Size& viewport_size, |
94 const gfx::Rect& viewport_rect_for_tile_priority, | 95 const gfx::Rect& viewport_rect_for_tile_priority, |
95 const gfx::Transform& transform_for_tile_priority) = 0; | 96 const gfx::Transform& transform_for_tile_priority) = 0; |
96 | 97 |
97 // For delegated rendering, return resources from parent compositor to this. | 98 // For delegated rendering, return resources from parent compositor to this. |
98 // Note that all resources must be returned before ReleaseHwDraw. | 99 // Note that all resources must be returned before ReleaseHwDraw. |
99 virtual void ReturnResources(uint32_t compositor_frame_sink_id, | 100 virtual void ReturnResources(uint32_t compositor_frame_sink_id, |
100 const cc::ReturnedResourceArray& resources) = 0; | 101 const cc::ReturnedResourceArray& resources) = 0; |
101 | 102 |
102 // "On demand" SW draw, into the supplied canvas (observing the transform | 103 // "On demand" SW draw, into the supplied canvas (observing the transform |
(...skipping 17 matching lines...) Expand all Loading... |
120 // and if any input animation is active, it should tick now. | 121 // and if any input animation is active, it should tick now. |
121 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; | 122 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; |
122 | 123 |
123 protected: | 124 protected: |
124 virtual ~SynchronousCompositor() {} | 125 virtual ~SynchronousCompositor() {} |
125 }; | 126 }; |
126 | 127 |
127 } // namespace content | 128 } // namespace content |
128 | 129 |
129 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 130 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |