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 #include "android_webview/browser/hardware_renderer.h" | 5 #include "android_webview/browser/hardware_renderer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/aw_gl_surface.h" | 9 #include "android_webview/browser/aw_gl_surface.h" |
10 #include "android_webview/browser/aw_render_thread_context_provider.h" | 10 #include "android_webview/browser/aw_render_thread_context_provider.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 std::unique_ptr<ChildFrame> child_frame = | 61 std::unique_ptr<ChildFrame> child_frame = |
62 render_thread_manager_->PassFrameOnRT(); | 62 render_thread_manager_->PassFrameOnRT(); |
63 if (!child_frame.get()) | 63 if (!child_frame.get()) |
64 return; | 64 return; |
65 | 65 |
66 last_committed_compositor_frame_sink_id_ = | 66 last_committed_compositor_frame_sink_id_ = |
67 child_frame->compositor_frame_sink_id; | 67 child_frame->compositor_frame_sink_id; |
68 ReturnResourcesInChildFrame(); | 68 ReturnResourcesInChildFrame(); |
69 child_frame_ = std::move(child_frame); | 69 child_frame_ = std::move(child_frame); |
70 DCHECK(child_frame_->frame.get()); | 70 DCHECK(child_frame_->frame.get()); |
71 DCHECK(!child_frame_->frame->gl_frame_data); | |
72 } | 71 } |
73 | 72 |
74 void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info) { | 73 void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info) { |
75 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); | 74 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); |
76 | 75 |
77 // We need to watch if the current Android context has changed and enforce | 76 // We need to watch if the current Android context has changed and enforce |
78 // a clean-up in the compositor. | 77 // a clean-up in the compositor. |
79 EGLContext current_context = eglGetCurrentContext(); | 78 EGLContext current_context = eglGetCurrentContext(); |
80 DCHECK(current_context) << "DrawGL called without EGLContext"; | 79 DCHECK(current_context) << "DrawGL called without EGLContext"; |
81 | 80 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 const cc::ReturnedResourceArray& resources, | 192 const cc::ReturnedResourceArray& resources, |
194 const CompositorID& compositor_id, | 193 const CompositorID& compositor_id, |
195 uint32_t compositor_frame_sink_id) { | 194 uint32_t compositor_frame_sink_id) { |
196 if (compositor_frame_sink_id != last_committed_compositor_frame_sink_id_) | 195 if (compositor_frame_sink_id != last_committed_compositor_frame_sink_id_) |
197 return; | 196 return; |
198 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, | 197 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, |
199 compositor_frame_sink_id); | 198 compositor_frame_sink_id); |
200 } | 199 } |
201 | 200 |
202 } // namespace android_webview | 201 } // namespace android_webview |
OLD | NEW |