| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "android_webview/browser/compositor_id.h" | 10 #include "android_webview/browser/compositor_id.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "cc/surfaces/surface_factory_client.h" | 13 #include "cc/surfaces/surface_factory_client.h" |
| 14 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
| 15 | 15 |
| 16 struct AwDrawGLInfo; | 16 struct AwDrawGLInfo; |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 class Display; | 19 class Display; |
| 20 class SurfaceFactory; | 20 class SurfaceFactory; |
| 21 class SurfaceIdAllocator; | 21 class SurfaceIdAllocator; |
| 22 class SurfaceManager; | 22 class SurfaceManager; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace android_webview { | 25 namespace android_webview { |
| 26 | 26 |
| 27 class ChildFrame; | 27 class ChildFrame; |
| 28 class RenderThreadManager; | 28 class RenderThreadManager; |
| 29 class ScopedAppGLStateRestore; | |
| 30 class SurfacesInstance; | 29 class SurfacesInstance; |
| 31 | 30 |
| 32 class HardwareRenderer : public cc::SurfaceFactoryClient { | 31 class HardwareRenderer : public cc::SurfaceFactoryClient { |
| 33 public: | 32 public: |
| 34 explicit HardwareRenderer(RenderThreadManager* state); | 33 explicit HardwareRenderer(RenderThreadManager* state); |
| 35 ~HardwareRenderer() override; | 34 ~HardwareRenderer() override; |
| 36 | 35 |
| 37 void DrawGL(AwDrawGLInfo* draw_info, const ScopedAppGLStateRestore& gl_state); | 36 void DrawGL(AwDrawGLInfo* draw_info); |
| 38 void CommitFrame(); | 37 void CommitFrame(); |
| 39 | 38 |
| 40 void SetBackingFrameBufferObject(int framebuffer_binding_ext); | |
| 41 | |
| 42 private: | 39 private: |
| 43 // cc::SurfaceFactoryClient implementation. | 40 // cc::SurfaceFactoryClient implementation. |
| 44 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 41 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 45 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 42 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 46 | 43 |
| 47 void ReturnResourcesInChildFrame(); | 44 void ReturnResourcesInChildFrame(); |
| 48 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, | 45 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, |
| 49 const CompositorID& compositor_id, | 46 const CompositorID& compositor_id, |
| 50 uint32_t output_surface_id); | 47 uint32_t output_surface_id); |
| 51 | 48 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 77 // output_surface_id, and resources for old output surfaces are dropped. | 74 // output_surface_id, and resources for old output surfaces are dropped. |
| 78 uint32_t last_committed_output_surface_id_; | 75 uint32_t last_committed_output_surface_id_; |
| 79 uint32_t last_submitted_output_surface_id_; | 76 uint32_t last_submitted_output_surface_id_; |
| 80 | 77 |
| 81 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 78 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
| 82 }; | 79 }; |
| 83 | 80 |
| 84 } // namespace android_webview | 81 } // namespace android_webview |
| 85 | 82 |
| 86 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 83 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| OLD | NEW |