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/hardware_renderer_interface.h" | |
9 #include "android_webview/browser/shared_renderer_state.h" | 8 #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" |
12 #include "cc/trees/layer_tree_host_client.h" | 11 #include "cc/trees/layer_tree_host_client.h" |
13 #include "cc/trees/layer_tree_host_single_thread_client.h" | 12 #include "cc/trees/layer_tree_host_single_thread_client.h" |
14 | 13 |
15 struct AwDrawGLInfo; | 14 struct AwDrawGLInfo; |
16 | 15 |
17 namespace cc { | 16 namespace cc { |
18 class DelegatedFrameProvider; | 17 class DelegatedFrameProvider; |
19 class DelegatedRendererLayer; | 18 class DelegatedRendererLayer; |
20 class Layer; | 19 class Layer; |
21 class LayerTreeHost; | 20 class LayerTreeHost; |
22 } | 21 } |
23 | 22 |
24 namespace android_webview { | 23 namespace android_webview { |
25 | 24 |
26 class AwGLSurface; | 25 class AwGLSurface; |
27 class ParentOutputSurface; | 26 class ParentOutputSurface; |
28 | 27 |
29 class HardwareRenderer : public HardwareRendererInterface, | 28 class HardwareRenderer : public cc::LayerTreeHostClient, |
30 public cc::LayerTreeHostClient, | |
31 public cc::LayerTreeHostSingleThreadClient, | 29 public cc::LayerTreeHostSingleThreadClient, |
32 public cc::DelegatedFrameResourceCollectionClient { | 30 public cc::DelegatedFrameResourceCollectionClient { |
33 public: | 31 public: |
34 explicit HardwareRenderer(SharedRendererState* state); | 32 explicit HardwareRenderer(SharedRendererState* state); |
35 virtual ~HardwareRenderer(); | 33 virtual ~HardwareRenderer(); |
36 | 34 |
37 // HardwareRendererInterface overrides. | 35 bool DrawGL(bool stencil_enabled, |
38 virtual bool DrawGL(bool stencil_enabled, | 36 int framebuffer_binding_ext, |
39 int framebuffer_binding_ext, | 37 AwDrawGLInfo* draw_info); |
40 AwDrawGLInfo* draw_info, | |
41 DrawGLResult* result) OVERRIDE; | |
42 | 38 |
43 // cc::LayerTreeHostClient overrides. | 39 // cc::LayerTreeHostClient overrides. |
44 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | 40 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |
45 virtual void DidBeginMainFrame() OVERRIDE; | 41 virtual void DidBeginMainFrame() OVERRIDE; |
46 virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE {} | 42 virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE {} |
47 virtual void Layout() OVERRIDE {} | 43 virtual void Layout() OVERRIDE {} |
48 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | 44 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, |
49 float page_scale) OVERRIDE {} | 45 float page_scale) OVERRIDE {} |
50 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 46 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
51 bool fallback) OVERRIDE; | 47 bool fallback) OVERRIDE; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 86 |
91 // This is owned indirectly by |layer_tree_host_|. | 87 // This is owned indirectly by |layer_tree_host_|. |
92 ParentOutputSurface* output_surface_; | 88 ParentOutputSurface* output_surface_; |
93 | 89 |
94 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 90 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
95 }; | 91 }; |
96 | 92 |
97 } // namespace android_webview | 93 } // namespace android_webview |
98 | 94 |
99 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 95 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
OLD | NEW |