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> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "cc/resources/returned_resource.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
17 | 18 |
18 class SkCanvas; | 19 class SkCanvas; |
19 | 20 |
20 namespace cc { | 21 namespace cc { |
21 class CompositorFrame; | 22 class CompositorFrame; |
22 class CompositorFrameAck; | 23 class CompositorFrameAck; |
23 } | 24 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const gfx::Size& surface_size, | 65 const gfx::Size& surface_size, |
65 const gfx::Transform& transform, | 66 const gfx::Transform& transform, |
66 const gfx::Rect& viewport, | 67 const gfx::Rect& viewport, |
67 const gfx::Rect& clip, | 68 const gfx::Rect& clip, |
68 const gfx::Rect& viewport_rect_for_tile_priority, | 69 const gfx::Rect& viewport_rect_for_tile_priority, |
69 const gfx::Transform& transform_for_tile_priority) = 0; | 70 const gfx::Transform& transform_for_tile_priority) = 0; |
70 | 71 |
71 // For delegated rendering, return resources from parent compositor to this. | 72 // For delegated rendering, return resources from parent compositor to this. |
72 // Note that all resources must be returned before ReleaseHwDraw. | 73 // Note that all resources must be returned before ReleaseHwDraw. |
73 virtual void ReturnResources(uint32_t output_surface_id, | 74 virtual void ReturnResources(uint32_t output_surface_id, |
74 const cc::CompositorFrameAck& frame_ack) = 0; | 75 const cc::ReturnedResourceArray& resources) = 0; |
75 | 76 |
76 // "On demand" SW draw, into the supplied canvas (observing the transform | 77 // "On demand" SW draw, into the supplied canvas (observing the transform |
77 // and clip set there-in). | 78 // and clip set there-in). |
78 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; | 79 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; |
79 | 80 |
80 // Set the memory limit policy of this compositor. | 81 // Set the memory limit policy of this compositor. |
81 virtual void SetMemoryPolicy(size_t bytes_limit) = 0; | 82 virtual void SetMemoryPolicy(size_t bytes_limit) = 0; |
82 | 83 |
83 // Should be called by the embedder after the embedder had modified the | 84 // Should be called by the embedder after the embedder had modified the |
84 // scroll offset of the root layer. | 85 // scroll offset of the root layer. |
85 virtual void DidChangeRootLayerScrollOffset( | 86 virtual void DidChangeRootLayerScrollOffset( |
86 const gfx::ScrollOffset& root_offset) = 0; | 87 const gfx::ScrollOffset& root_offset) = 0; |
87 | 88 |
88 // Allows embedder to synchronously update the zoom level, ie page scale | 89 // Allows embedder to synchronously update the zoom level, ie page scale |
89 // factor, around the anchor point. | 90 // factor, around the anchor point. |
90 virtual void SynchronouslyZoomBy(float zoom_delta, | 91 virtual void SynchronouslyZoomBy(float zoom_delta, |
91 const gfx::Point& anchor) = 0; | 92 const gfx::Point& anchor) = 0; |
92 | 93 |
93 // Called by the embedder to notify that the OnComputeScroll step is happening | 94 // Called by the embedder to notify that the OnComputeScroll step is happening |
94 // and if any input animation is active, it should tick now. | 95 // and if any input animation is active, it should tick now. |
95 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; | 96 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; |
96 | 97 |
97 protected: | 98 protected: |
98 virtual ~SynchronousCompositor() {} | 99 virtual ~SynchronousCompositor() {} |
99 }; | 100 }; |
100 | 101 |
101 } // namespace content | 102 } // namespace content |
102 | 103 |
103 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 104 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |