| 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_RENDER_THREAD_MANAGER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "android_webview/browser/compositor_frame_consumer.h" | 10 #include "android_webview/browser/compositor_frame_consumer.h" |
| 11 #include "android_webview/browser/gl_view_renderer_manager.h" | 11 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 12 #include "android_webview/browser/parent_compositor_draw_constraints.h" | 12 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
| 13 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "cc/output/compositor_frame_ack.h" | 18 #include "cc/output/compositor_frame_ack.h" |
| 19 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 20 #include "ui/gfx/geometry/vector2d.h" | 20 #include "ui/gfx/geometry/vector2d.h" |
| 21 | 21 |
| 22 struct AwDrawGLInfo; | 22 struct AwDrawGLInfo; |
| 23 namespace android_webview { | 23 namespace android_webview { |
| 24 | 24 |
| 25 namespace internal { | 25 namespace internal { |
| 26 class RequestInvokeGLTracker; | 26 class RequestInvokeGLTracker; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class RenderThreadManagerClient; | 29 class RenderThreadManagerClient; |
| 30 class ChildFrame; |
| 30 class CompositorFrameProducer; | 31 class CompositorFrameProducer; |
| 31 class ChildFrame; | |
| 32 class HardwareRenderer; | 32 class HardwareRenderer; |
| 33 class InsideHardwareReleaseReset; | 33 class InsideHardwareReleaseReset; |
| 34 struct CompositorID; |
| 34 | 35 |
| 35 // This class is used to pass data between UI thread and RenderThread. | 36 // This class is used to pass data between UI thread and RenderThread. |
| 36 class RenderThreadManager : public CompositorFrameConsumer { | 37 class RenderThreadManager : public CompositorFrameConsumer { |
| 37 public: | 38 public: |
| 38 RenderThreadManager( | 39 RenderThreadManager( |
| 39 RenderThreadManagerClient* client, | 40 RenderThreadManagerClient* client, |
| 40 const scoped_refptr<base::SingleThreadTaskRunner>& ui_loop); | 41 const scoped_refptr<base::SingleThreadTaskRunner>& ui_loop); |
| 41 ~RenderThreadManager() override; | 42 ~RenderThreadManager() override; |
| 42 | 43 |
| 43 // This function can be called from any thread. | 44 // This function can be called from any thread. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 57 bool HasFrameOnUI() const override; | 58 bool HasFrameOnUI() const override; |
| 58 void DeleteHardwareRendererOnUI() override; | 59 void DeleteHardwareRendererOnUI() override; |
| 59 | 60 |
| 60 // RT thread methods. | 61 // RT thread methods. |
| 61 gfx::Vector2d GetScrollOffsetOnRT(); | 62 gfx::Vector2d GetScrollOffsetOnRT(); |
| 62 std::unique_ptr<ChildFrame> PassFrameOnRT(); | 63 std::unique_ptr<ChildFrame> PassFrameOnRT(); |
| 63 void DrawGL(AwDrawGLInfo* draw_info); | 64 void DrawGL(AwDrawGLInfo* draw_info); |
| 64 void PostExternalDrawConstraintsToChildCompositorOnRT( | 65 void PostExternalDrawConstraintsToChildCompositorOnRT( |
| 65 const ParentCompositorDrawConstraints& parent_draw_constraints); | 66 const ParentCompositorDrawConstraints& parent_draw_constraints); |
| 66 void InsertReturnedResourcesOnRT(const cc::ReturnedResourceArray& resources, | 67 void InsertReturnedResourcesOnRT(const cc::ReturnedResourceArray& resources, |
| 67 uint32_t compositor_id, | 68 const CompositorID& compositor_id, |
| 68 uint32_t output_surface_id); | 69 uint32_t output_surface_id); |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 friend class internal::RequestInvokeGLTracker; | 72 friend class internal::RequestInvokeGLTracker; |
| 72 class InsideHardwareReleaseReset { | 73 class InsideHardwareReleaseReset { |
| 73 public: | 74 public: |
| 74 explicit InsideHardwareReleaseReset( | 75 explicit InsideHardwareReleaseReset( |
| 75 RenderThreadManager* render_thread_manager); | 76 RenderThreadManager* render_thread_manager); |
| 76 ~InsideHardwareReleaseReset(); | 77 ~InsideHardwareReleaseReset(); |
| 77 | 78 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::Closure request_draw_gl_closure_; | 115 base::Closure request_draw_gl_closure_; |
| 115 | 116 |
| 116 base::WeakPtrFactory<RenderThreadManager> weak_factory_on_ui_thread_; | 117 base::WeakPtrFactory<RenderThreadManager> weak_factory_on_ui_thread_; |
| 117 | 118 |
| 118 DISALLOW_COPY_AND_ASSIGN(RenderThreadManager); | 119 DISALLOW_COPY_AND_ASSIGN(RenderThreadManager); |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 } // namespace android_webview | 122 } // namespace android_webview |
| 122 | 123 |
| 123 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ | 124 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ |
| OLD | NEW |