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/browser_view_renderer.h" | 5 #include "android_webview/browser/browser_view_renderer.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "android_webview/browser/browser_view_renderer_client.h" | 9 #include "android_webview/browser/browser_view_renderer_client.h" |
8 #include "android_webview/browser/child_frame.h" | 10 #include "android_webview/browser/child_frame.h" |
9 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "base/logging.h" | 13 #include "base/logging.h" |
12 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
14 #include "base/supports_user_data.h" | 16 #include "base/supports_user_data.h" |
15 #include "base/trace_event/trace_event_argument.h" | 17 #include "base/trace_event/trace_event_argument.h" |
16 #include "cc/output/compositor_frame.h" | 18 #include "cc/output/compositor_frame.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 clip, | 266 clip, |
265 viewport_rect_for_tile_priority, | 267 viewport_rect_for_tile_priority, |
266 transform_for_tile_priority); | 268 transform_for_tile_priority); |
267 if (!frame.get()) { | 269 if (!frame.get()) { |
268 TRACE_EVENT_INSTANT0("android_webview", "NoNewFrame", | 270 TRACE_EVENT_INSTANT0("android_webview", "NoNewFrame", |
269 TRACE_EVENT_SCOPE_THREAD); | 271 TRACE_EVENT_SCOPE_THREAD); |
270 return shared_renderer_state_.HasFrameOnUI(); | 272 return shared_renderer_state_.HasFrameOnUI(); |
271 } | 273 } |
272 | 274 |
273 scoped_ptr<ChildFrame> child_frame = make_scoped_ptr(new ChildFrame( | 275 scoped_ptr<ChildFrame> child_frame = make_scoped_ptr(new ChildFrame( |
274 frame.Pass(), GetCompositorID(compositor_), | 276 std::move(frame), GetCompositorID(compositor_), |
275 viewport_rect_for_tile_priority.IsEmpty(), transform_for_tile_priority, | 277 viewport_rect_for_tile_priority.IsEmpty(), transform_for_tile_priority, |
276 offscreen_pre_raster_, parent_draw_constraints.is_layer)); | 278 offscreen_pre_raster_, parent_draw_constraints.is_layer)); |
277 | 279 |
278 // Uncommitted frame can happen with consecutive fallback ticks. | 280 // Uncommitted frame can happen with consecutive fallback ticks. |
279 ReturnUnusedResource(shared_renderer_state_.PassUncommittedFrameOnUI()); | 281 ReturnUnusedResource(shared_renderer_state_.PassUncommittedFrameOnUI()); |
280 shared_renderer_state_.SetCompositorFrameOnUI(child_frame.Pass()); | 282 shared_renderer_state_.SetCompositorFrameOnUI(std::move(child_frame)); |
281 return true; | 283 return true; |
282 } | 284 } |
283 | 285 |
284 void BrowserViewRenderer::UpdateParentDrawConstraints() { | 286 void BrowserViewRenderer::UpdateParentDrawConstraints() { |
285 PostInvalidateWithFallback(); | 287 PostInvalidateWithFallback(); |
286 ParentCompositorDrawConstraints parent_draw_constraints = | 288 ParentCompositorDrawConstraints parent_draw_constraints = |
287 shared_renderer_state_.GetParentDrawConstraintsOnUI(); | 289 shared_renderer_state_.GetParentDrawConstraintsOnUI(); |
288 client_->ParentDrawConstraintsUpdated(parent_draw_constraints); | 290 client_->ParentDrawConstraintsUpdated(parent_draw_constraints); |
289 } | 291 } |
290 | 292 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 base::StringAppendF(&str, | 804 base::StringAppendF(&str, |
803 "overscroll_rounding_error_: %s ", | 805 "overscroll_rounding_error_: %s ", |
804 overscroll_rounding_error_.ToString().c_str()); | 806 overscroll_rounding_error_.ToString().c_str()); |
805 base::StringAppendF( | 807 base::StringAppendF( |
806 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); | 808 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); |
807 base::StringAppendF(&str, "clear_view: %d ", clear_view_); | 809 base::StringAppendF(&str, "clear_view: %d ", clear_view_); |
808 return str; | 810 return str; |
809 } | 811 } |
810 | 812 |
811 } // namespace android_webview | 813 } // namespace android_webview |
OLD | NEW |