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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 SynchronousCompositorClient* client); | 45 SynchronousCompositorClient* client); |
46 | 46 |
47 struct Frame { | 47 struct Frame { |
48 Frame(); | 48 Frame(); |
49 ~Frame(); | 49 ~Frame(); |
50 | 50 |
51 // Movable type. | 51 // Movable type. |
52 Frame(Frame&& rhs); | 52 Frame(Frame&& rhs); |
53 Frame& operator=(Frame&& rhs); | 53 Frame& operator=(Frame&& rhs); |
54 | 54 |
55 uint32_t output_surface_id; | 55 uint32_t compositor_frame_sink_id; |
56 std::unique_ptr<cc::CompositorFrame> frame; | 56 std::unique_ptr<cc::CompositorFrame> frame; |
57 | 57 |
58 private: | 58 private: |
59 DISALLOW_COPY_AND_ASSIGN(Frame); | 59 DISALLOW_COPY_AND_ASSIGN(Frame); |
60 }; | 60 }; |
61 | 61 |
62 // "On demand" hardware draw. Parameters are used by compositor for this draw. | 62 // "On demand" hardware draw. Parameters are used by compositor for this draw. |
63 // |viewport_size| is the current size to improve results during resize. | 63 // |viewport_size| is the current size to improve results during resize. |
64 // |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are | 64 // |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are |
65 // used to customize the tiling decisions of compositor. | 65 // used to customize the tiling decisions of compositor. |
66 virtual Frame DemandDrawHw( | 66 virtual Frame DemandDrawHw( |
67 const gfx::Size& viewport_size, | 67 const gfx::Size& viewport_size, |
68 const gfx::Rect& viewport_rect_for_tile_priority, | 68 const gfx::Rect& viewport_rect_for_tile_priority, |
69 const gfx::Transform& transform_for_tile_priority) = 0; | 69 const gfx::Transform& transform_for_tile_priority) = 0; |
70 | 70 |
71 // Same as DemandDrawHw, but uses asynchronous IPC messages. Calls | 71 // Same as DemandDrawHw, but uses asynchronous IPC messages. Calls |
72 // SynchronousCompositorClient::OnDrawHardwareProcessFrame to return the | 72 // SynchronousCompositorClient::OnDrawHardwareProcessFrame to return the |
73 // frame. | 73 // frame. |
74 virtual void DemandDrawHwAsync( | 74 virtual void DemandDrawHwAsync( |
75 const gfx::Size& viewport_size, | 75 const gfx::Size& viewport_size, |
76 const gfx::Rect& viewport_rect_for_tile_priority, | 76 const gfx::Rect& viewport_rect_for_tile_priority, |
77 const gfx::Transform& transform_for_tile_priority) = 0; | 77 const gfx::Transform& transform_for_tile_priority) = 0; |
78 | 78 |
79 // For delegated rendering, return resources from parent compositor to this. | 79 // For delegated rendering, return resources from parent compositor to this. |
80 // Note that all resources must be returned before ReleaseHwDraw. | 80 // Note that all resources must be returned before ReleaseHwDraw. |
81 virtual void ReturnResources(uint32_t output_surface_id, | 81 virtual void ReturnResources(uint32_t compositor_frame_sink_id, |
82 const cc::ReturnedResourceArray& resources) = 0; | 82 const cc::ReturnedResourceArray& resources) = 0; |
83 | 83 |
84 // "On demand" SW draw, into the supplied canvas (observing the transform | 84 // "On demand" SW draw, into the supplied canvas (observing the transform |
85 // and clip set there-in). | 85 // and clip set there-in). |
86 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; | 86 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; |
87 | 87 |
88 // Set the memory limit policy of this compositor. | 88 // Set the memory limit policy of this compositor. |
89 virtual void SetMemoryPolicy(size_t bytes_limit) = 0; | 89 virtual void SetMemoryPolicy(size_t bytes_limit) = 0; |
90 | 90 |
91 // Should be called by the embedder after the embedder had modified the | 91 // Should be called by the embedder after the embedder had modified the |
(...skipping 10 matching lines...) Expand all Loading... |
102 // and if any input animation is active, it should tick now. | 102 // and if any input animation is active, it should tick now. |
103 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; | 103 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; |
104 | 104 |
105 protected: | 105 protected: |
106 virtual ~SynchronousCompositor() {} | 106 virtual ~SynchronousCompositor() {} |
107 }; | 107 }; |
108 | 108 |
109 } // namespace content | 109 } // namespace content |
110 | 110 |
111 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 111 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |