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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 struct CONTENT_EXPORT SynchronousCompositorMemoryPolicy { | 27 struct CONTENT_EXPORT SynchronousCompositorMemoryPolicy { |
28 // Memory limit for rendering and pre-rendering. | 28 // Memory limit for rendering and pre-rendering. |
29 size_t bytes_limit; | 29 size_t bytes_limit; |
30 | 30 |
31 // Limit of number of GL resources used for rendering and pre-rendering. | 31 // Limit of number of GL resources used for rendering and pre-rendering. |
32 size_t num_resources_limit; | 32 size_t num_resources_limit; |
33 | 33 |
34 SynchronousCompositorMemoryPolicy(); | 34 SynchronousCompositorMemoryPolicy(); |
35 | 35 |
| 36 SynchronousCompositorMemoryPolicy(size_t bytes, size_t num_resources); |
| 37 |
36 bool operator==(const SynchronousCompositorMemoryPolicy& other) const; | 38 bool operator==(const SynchronousCompositorMemoryPolicy& other) const; |
37 bool operator!=(const SynchronousCompositorMemoryPolicy& other) const; | 39 bool operator!=(const SynchronousCompositorMemoryPolicy& other) const; |
38 }; | 40 }; |
39 | 41 |
40 // Interface for embedders that wish to direct compositing operations | 42 // Interface for embedders that wish to direct compositing operations |
41 // synchronously under their own control. Only meaningful when the | 43 // synchronously under their own control. Only meaningful when the |
42 // kEnableSyncrhonousRendererCompositor flag is specified. | 44 // kEnableSyncrhonousRendererCompositor flag is specified. |
43 class CONTENT_EXPORT SynchronousCompositor { | 45 class CONTENT_EXPORT SynchronousCompositor { |
44 public: | 46 public: |
45 // Must be called once per WebContents instance. Will create the compositor | 47 // Must be called once per WebContents instance. Will create the compositor |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool stencil_enabled) = 0; | 81 bool stencil_enabled) = 0; |
80 | 82 |
81 // "On demand" SW draw, into the supplied canvas (observing the transform | 83 // "On demand" SW draw, into the supplied canvas (observing the transform |
82 // and clip set there-in). | 84 // and clip set there-in). |
83 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; | 85 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; |
84 | 86 |
85 // Set the memory limit policy of this compositor. | 87 // Set the memory limit policy of this compositor. |
86 virtual void SetMemoryPolicy( | 88 virtual void SetMemoryPolicy( |
87 const SynchronousCompositorMemoryPolicy& policy) = 0; | 89 const SynchronousCompositorMemoryPolicy& policy) = 0; |
88 | 90 |
| 91 // Get the memory limit policy of this compositor. |
| 92 virtual const SynchronousCompositorMemoryPolicy& GetMemoryPolicy() const = 0; |
| 93 |
89 // Should be called by the embedder after the embedder had modified the | 94 // Should be called by the embedder after the embedder had modified the |
90 // scroll offset of the root layer (as returned by | 95 // scroll offset of the root layer (as returned by |
91 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). | 96 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). |
92 virtual void DidChangeRootLayerScrollOffset() = 0; | 97 virtual void DidChangeRootLayerScrollOffset() = 0; |
93 | 98 |
94 protected: | 99 protected: |
95 virtual ~SynchronousCompositor() {} | 100 virtual ~SynchronousCompositor() {} |
96 }; | 101 }; |
97 | 102 |
98 } // namespace content | 103 } // namespace content |
99 | 104 |
100 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 105 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |