Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: android_webview/browser/in_process_view_renderer.cc

Issue 15029006: Make it possible for the scroll offset delegate to intercept fling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reactivate the patch! Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/in_process_view_renderer.h" 5 #include "android_webview/browser/in_process_view_renderer.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "android_webview/browser/scoped_app_gl_state_restore.h" 9 #include "android_webview/browser/scoped_app_gl_state_restore.h"
10 #include "android_webview/public/browser/draw_gl.h" 10 #include "android_webview/public/browser/draw_gl.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 DCHECK(dip_scale_ > 0); 531 DCHECK(dip_scale_ > 0);
532 // In general we don't guarantee that the scroll offset transforms are 532 // In general we don't guarantee that the scroll offset transforms are
533 // symmetrical. That is if scrolling from JS to offset1 results in a native 533 // symmetrical. That is if scrolling from JS to offset1 results in a native
534 // offset2 then scrolling from UI to offset2 results in JS being scrolled to 534 // offset2 then scrolling from UI to offset2 results in JS being scrolled to
535 // offset1 again. 535 // offset1 again.
536 // The reason we explicitly do rounding here is that it seems to yeld the 536 // The reason we explicitly do rounding here is that it seems to yeld the
537 // most stabile transformation. 537 // most stabile transformation.
538 gfx::Vector2dF new_value_css = gfx::ToRoundedVector2d( 538 gfx::Vector2dF new_value_css = gfx::ToRoundedVector2d(
539 gfx::ScaleVector2d(new_value, 1.0f / (dip_scale_ * page_scale_factor_))); 539 gfx::ScaleVector2d(new_value, 1.0f / (dip_scale_ * page_scale_factor_)));
540 540
541 DCHECK(scroll_offset_css_ != new_value_css); 541 // It's possible that more than one set of unique physical coordinates maps
542 // to the same set of CSS coordinates which means we can't reliably early-out
543 // earlier in the call stack.
544 if (scroll_offset_css_ == new_value_css)
545 return;
542 546
543 scroll_offset_css_ = new_value_css; 547 scroll_offset_css_ = new_value_css;
544 548
545 if (compositor_) 549 if (compositor_)
546 compositor_->DidChangeRootLayerScrollOffset(); 550 compositor_->DidChangeRootLayerScrollOffset();
547 } 551 }
548 552
549 void InProcessViewRenderer::DidUpdateContent() { 553 void InProcessViewRenderer::DidUpdateContent() {
550 if (on_new_picture_enable_) 554 if (on_new_picture_enable_)
551 client_->OnNewPicture(); 555 client_->OnNewPicture();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 base::StringAppendF(&str, 673 base::StringAppendF(&str,
670 "surface width height: [%d %d] ", 674 "surface width height: [%d %d] ",
671 draw_info->width, 675 draw_info->width,
672 draw_info->height); 676 draw_info->height);
673 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); 677 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer);
674 } 678 }
675 return str; 679 return str;
676 } 680 }
677 681
678 } // namespace android_webview 682 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698