| 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/child_frame.h" | 10 #include "android_webview/browser/child_frame.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void CommitFrame(); | 49 void CommitFrame(); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // cc::CompositorFrameSinkSupportClient implementation. | 52 // cc::CompositorFrameSinkSupportClient implementation. |
| 53 void DidReceiveCompositorFrameAck( | 53 void DidReceiveCompositorFrameAck( |
| 54 const cc::ReturnedResourceArray& resources) override; | 54 const cc::ReturnedResourceArray& resources) override; |
| 55 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 55 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
| 56 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 56 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 57 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, | 57 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, |
| 58 const gfx::Rect& damage_rect) override; | 58 const gfx::Rect& damage_rect) override; |
| 59 void DidRejectCompositorFrame() override; |
| 59 | 60 |
| 60 void ReturnChildFrame(std::unique_ptr<ChildFrame> child_frame); | 61 void ReturnChildFrame(std::unique_ptr<ChildFrame> child_frame); |
| 61 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, | 62 void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources, |
| 62 const CompositorID& compositor_id, | 63 const CompositorID& compositor_id, |
| 63 uint32_t compositor_frame_sink_id); | 64 uint32_t compositor_frame_sink_id); |
| 64 | 65 |
| 65 void AllocateSurface(); | 66 void AllocateSurface(); |
| 66 void DestroySurface(); | 67 void DestroySurface(); |
| 67 | 68 |
| 68 void CreateNewCompositorFrameSinkSupport(); | 69 void CreateNewCompositorFrameSinkSupport(); |
| 69 | 70 |
| 70 RenderThreadManager* render_thread_manager_; | 71 RenderThreadManager* render_thread_manager_; |
| 71 | 72 |
| 72 typedef void* EGLContext; | 73 typedef void* EGLContext; |
| 73 EGLContext last_egl_context_; | 74 EGLContext last_egl_context_; |
| 74 | 75 |
| 75 // Information about last delegated frame. | 76 // Information about last delegated frame. |
| 76 gfx::Size frame_size_; | 77 gfx::Size surface_size_; |
| 78 float device_scale_factor_ = 0; |
| 77 | 79 |
| 78 // Infromation from UI on last commit. | 80 // Infromation from UI on last commit. |
| 79 gfx::Vector2d scroll_offset_; | 81 gfx::Vector2d scroll_offset_; |
| 80 | 82 |
| 81 ChildFrameQueue child_frame_queue_; | 83 ChildFrameQueue child_frame_queue_; |
| 82 | 84 |
| 83 // This holds the last ChildFrame received. Contains the frame info of the | 85 // This holds the last ChildFrame received. Contains the frame info of the |
| 84 // last frame. The |frame| member is always null since frame has already | 86 // last frame. The |frame| member is always null since frame has already |
| 85 // been submitted. | 87 // been submitted. |
| 86 std::unique_ptr<ChildFrame> child_frame_; | 88 std::unique_ptr<ChildFrame> child_frame_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 97 // dropped. | 99 // dropped. |
| 98 uint32_t last_committed_compositor_frame_sink_id_; | 100 uint32_t last_committed_compositor_frame_sink_id_; |
| 99 uint32_t last_submitted_compositor_frame_sink_id_; | 101 uint32_t last_submitted_compositor_frame_sink_id_; |
| 100 | 102 |
| 101 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 103 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 } // namespace android_webview | 106 } // namespace android_webview |
| 105 | 107 |
| 106 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 108 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| OLD | NEW |