OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
7 | 7 |
8 #include "android_webview/browser/parent_compositor_draw_constraints.h" | 8 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
9 #include "android_webview/browser/shared_renderer_state.h" | |
10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
11 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
| 11 #include "cc/output/compositor_frame.h" |
12 #include "cc/trees/layer_tree_host_client.h" | 12 #include "cc/trees/layer_tree_host_client.h" |
13 #include "cc/trees/layer_tree_host_single_thread_client.h" | 13 #include "cc/trees/layer_tree_host_single_thread_client.h" |
14 | 14 |
15 struct AwDrawGLInfo; | 15 struct AwDrawGLInfo; |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 class DelegatedFrameProvider; | 18 class DelegatedFrameProvider; |
19 class DelegatedRendererLayer; | 19 class DelegatedRendererLayer; |
20 class Layer; | 20 class Layer; |
21 class LayerTreeHost; | 21 class LayerTreeHost; |
22 } | 22 } |
23 | 23 |
24 namespace android_webview { | 24 namespace android_webview { |
25 | 25 |
26 class AwGLSurface; | 26 class AwGLSurface; |
| 27 class HardwareRendererProxy; |
27 class ParentOutputSurface; | 28 class ParentOutputSurface; |
28 | 29 |
29 class HardwareRenderer : public cc::LayerTreeHostClient, | 30 class HardwareRenderer : public cc::LayerTreeHostClient, |
30 public cc::LayerTreeHostSingleThreadClient, | 31 public cc::LayerTreeHostSingleThreadClient, |
31 public cc::DelegatedFrameResourceCollectionClient { | 32 public cc::DelegatedFrameResourceCollectionClient { |
32 public: | 33 public: |
33 explicit HardwareRenderer(SharedRendererState* state); | 34 explicit HardwareRenderer(HardwareRendererProxy* proxy); |
34 virtual ~HardwareRenderer(); | 35 virtual ~HardwareRenderer(); |
35 | 36 |
36 void DrawGL(bool stencil_enabled, | 37 void DrawGL(bool stencil_enabled, |
37 int framebuffer_binding_ext, | 38 int framebuffer_binding_ext, |
38 AwDrawGLInfo* draw_info); | 39 AwDrawGLInfo* draw_info); |
39 void CommitFrame(); | 40 void CommitFrame(); |
40 | 41 |
41 // cc::LayerTreeHostClient overrides. | 42 // cc::LayerTreeHostClient overrides. |
42 virtual void WillBeginMainFrame(int frame_id) override {} | 43 virtual void WillBeginMainFrame(int frame_id) override {} |
43 virtual void DidBeginMainFrame() override; | 44 virtual void DidBeginMainFrame() override; |
(...skipping 16 matching lines...) Expand all Loading... |
60 // cc::LayerTreeHostSingleThreadClient overrides. | 61 // cc::LayerTreeHostSingleThreadClient overrides. |
61 virtual void DidPostSwapBuffers() override {} | 62 virtual void DidPostSwapBuffers() override {} |
62 virtual void DidAbortSwapBuffers() override {} | 63 virtual void DidAbortSwapBuffers() override {} |
63 | 64 |
64 // cc::DelegatedFrameResourceCollectionClient overrides. | 65 // cc::DelegatedFrameResourceCollectionClient overrides. |
65 virtual void UnusedResourcesAreAvailable() override; | 66 virtual void UnusedResourcesAreAvailable() override; |
66 | 67 |
67 private: | 68 private: |
68 void SetFrameData(); | 69 void SetFrameData(); |
69 | 70 |
70 SharedRendererState* shared_renderer_state_; | 71 HardwareRendererProxy* proxy_; |
71 | 72 |
72 typedef void* EGLContext; | 73 typedef void* EGLContext; |
73 EGLContext last_egl_context_; | 74 EGLContext last_egl_context_; |
74 | 75 |
75 scoped_ptr<cc::CompositorFrame> committed_frame_; | 76 scoped_ptr<cc::CompositorFrame> committed_frame_; |
76 | 77 |
77 // Information about last delegated frame. | 78 // Information about last delegated frame. |
78 gfx::Size frame_size_; | 79 gfx::Size frame_size_; |
79 | 80 |
80 // Infromation from UI on last commit. | 81 // Infromation from UI on last commit. |
(...skipping 18 matching lines...) Expand all Loading... |
99 ParentOutputSurface* output_surface_; | 100 ParentOutputSurface* output_surface_; |
100 | 101 |
101 ParentCompositorDrawConstraints draw_constraints_; | 102 ParentCompositorDrawConstraints draw_constraints_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 104 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace android_webview | 107 } // namespace android_webview |
107 | 108 |
108 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 109 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
OLD | NEW |