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 #include "android_webview/browser/browser_view_renderer.h" | 5 #include "android_webview/browser/browser_view_renderer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/browser_view_renderer_client.h" | 9 #include "android_webview/browser/browser_view_renderer_client.h" |
| 10 #include "android_webview/browser/child_frame.h" | 10 #include "android_webview/browser/child_frame.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 693 gfx::Vector2d rounded_overscroll_delta = gfx::ToRoundedVector2d( | 693 gfx::Vector2d rounded_overscroll_delta = gfx::ToRoundedVector2d( |
| 694 scaled_overscroll_delta + overscroll_rounding_error_); | 694 scaled_overscroll_delta + overscroll_rounding_error_); |
| 695 overscroll_rounding_error_ = | 695 overscroll_rounding_error_ = |
| 696 scaled_overscroll_delta - rounded_overscroll_delta; | 696 scaled_overscroll_delta - rounded_overscroll_delta; |
| 697 gfx::Vector2dF fling_velocity_pixels = | 697 gfx::Vector2dF fling_velocity_pixels = |
| 698 gfx::ScaleVector2d(current_fling_velocity, physical_pixel_scale); | 698 gfx::ScaleVector2d(current_fling_velocity, physical_pixel_scale); |
| 699 | 699 |
| 700 client_->DidOverscroll(rounded_overscroll_delta, fling_velocity_pixels); | 700 client_->DidOverscroll(rounded_overscroll_delta, fling_velocity_pixels); |
| 701 } | 701 } |
| 702 | 702 |
| 703 ui::TouchHandleDrawable* BrowserViewRenderer::CreateDrawable() { | |
| 704 CHECK_GT(dip_scale_, 0.f); | |
|
boliu
2016/08/24 23:35:30
hmm, curious, does this really need to be a releas
Jinsuk Kim
2016/08/25 07:32:21
Nope, meant to use DCHECK_GT like in other places
| |
| 705 return client_->CreateDrawable(dip_scale_); | |
| 706 } | |
| 707 | |
| 703 void BrowserViewRenderer::PostInvalidate( | 708 void BrowserViewRenderer::PostInvalidate( |
| 704 content::SynchronousCompositor* compositor) { | 709 content::SynchronousCompositor* compositor) { |
| 705 TRACE_EVENT_INSTANT0("android_webview", "BrowserViewRenderer::PostInvalidate", | 710 TRACE_EVENT_INSTANT0("android_webview", "BrowserViewRenderer::PostInvalidate", |
| 706 TRACE_EVENT_SCOPE_THREAD); | 711 TRACE_EVENT_SCOPE_THREAD); |
| 707 if (compositor != compositor_) | 712 if (compositor != compositor_) |
| 708 return; | 713 return; |
| 709 | 714 |
| 710 client_->PostInvalidate(); | 715 client_->PostInvalidate(); |
| 711 } | 716 } |
| 712 | 717 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 732 base::StringAppendF(&str, | 737 base::StringAppendF(&str, |
| 733 "overscroll_rounding_error_: %s ", | 738 "overscroll_rounding_error_: %s ", |
| 734 overscroll_rounding_error_.ToString().c_str()); | 739 overscroll_rounding_error_.ToString().c_str()); |
| 735 base::StringAppendF( | 740 base::StringAppendF( |
| 736 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); | 741 &str, "on_new_picture_enable: %d ", on_new_picture_enable_); |
| 737 base::StringAppendF(&str, "clear_view: %d ", clear_view_); | 742 base::StringAppendF(&str, "clear_view: %d ", clear_view_); |
| 738 return str; | 743 return str; |
| 739 } | 744 } |
| 740 | 745 |
| 741 } // namespace android_webview | 746 } // namespace android_webview |
| OLD | NEW |