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