Chromium Code Reviews| 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/render_thread_manager.h" | 11 #include "android_webview/browser/render_thread_manager.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "cc/surfaces/display_client.h" | 13 #include "cc/surfaces/display_client.h" |
| 13 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
| 14 #include "cc/surfaces/surface_id.h" | 15 #include "cc/surfaces/surface_id.h" |
| 15 | 16 |
| 16 struct AwDrawGLInfo; | 17 struct AwDrawGLInfo; |
| 17 | 18 |
| 18 namespace cc { | 19 namespace cc { |
| 19 class Display; | 20 class Display; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 44 // cc::DisplayClient overrides. | 45 // cc::DisplayClient overrides. |
| 45 void OutputSurfaceLost() override {} | 46 void OutputSurfaceLost() override {} |
| 46 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override {} | 47 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override {} |
| 47 | 48 |
| 48 // cc::SurfaceFactoryClient implementation. | 49 // cc::SurfaceFactoryClient implementation. |
| 49 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 50 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 50 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 51 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 51 | 52 |
| 52 void ReturnResourcesInChildFrame(); | 53 void ReturnResourcesInChildFrame(); |
| 53 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, | 54 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, |
| 54 uint32_t compositor_routing_id, | 55 CompositorID compositor_id, |
|
boliu
2016/06/13 15:30:44
const&
hush (inactive)
2016/06/14 23:48:28
Done.
| |
| 55 uint32_t output_surface_id); | 56 uint32_t output_surface_id); |
| 56 | 57 |
| 57 RenderThreadManager* render_thread_manager_; | 58 RenderThreadManager* render_thread_manager_; |
| 58 | 59 |
| 59 typedef void* EGLContext; | 60 typedef void* EGLContext; |
| 60 EGLContext last_egl_context_; | 61 EGLContext last_egl_context_; |
| 61 | 62 |
| 62 // Information about last delegated frame. | 63 // Information about last delegated frame. |
| 63 gfx::Size frame_size_; | 64 gfx::Size frame_size_; |
| 64 | 65 |
| 65 // Infromation from UI on last commit. | 66 // Infromation from UI on last commit. |
| 66 gfx::Vector2d scroll_offset_; | 67 gfx::Vector2d scroll_offset_; |
| 67 | 68 |
| 68 // This holds the last ChildFrame received. Contains the frame info of the | 69 // This holds the last ChildFrame received. Contains the frame info of the |
| 69 // last frame. The |frame| member may be null if it's already submitted to | 70 // last frame. The |frame| member may be null if it's already submitted to |
| 70 // SurfaceFactory. | 71 // SurfaceFactory. |
| 71 std::unique_ptr<ChildFrame> child_frame_; | 72 std::unique_ptr<ChildFrame> child_frame_; |
| 72 | 73 |
| 73 scoped_refptr<AwGLSurface> gl_surface_; | 74 scoped_refptr<AwGLSurface> gl_surface_; |
| 74 | 75 |
| 75 std::unique_ptr<cc::SurfaceManager> surface_manager_; | 76 std::unique_ptr<cc::SurfaceManager> surface_manager_; |
| 76 std::unique_ptr<cc::Display> display_; | 77 std::unique_ptr<cc::Display> display_; |
| 77 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | 78 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
| 78 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 79 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 79 cc::SurfaceId child_id_; | 80 cc::SurfaceId child_id_; |
| 80 cc::SurfaceId root_id_; | 81 cc::SurfaceId root_id_; |
| 81 uint32_t compositor_id_; | 82 CompositorID compositor_id_; |
| 82 // HardwareRenderer guarantees resources are returned in the order of | 83 // HardwareRenderer guarantees resources are returned in the order of |
| 83 // output_surface_id, and resources for old output surfaces are dropped. | 84 // output_surface_id, and resources for old output surfaces are dropped. |
| 84 uint32_t last_committed_output_surface_id_; | 85 uint32_t last_committed_output_surface_id_; |
| 85 uint32_t last_submitted_output_surface_id_; | 86 uint32_t last_submitted_output_surface_id_; |
| 86 | 87 |
| 87 // This is owned by |display_|. | 88 // This is owned by |display_|. |
| 88 ParentOutputSurface* output_surface_; | 89 ParentOutputSurface* output_surface_; |
| 89 | 90 |
| 90 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 91 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace android_webview | 94 } // namespace android_webview |
| 94 | 95 |
| 95 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 96 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| OLD | NEW |