diff options
author | Ben Murdoch <benm@google.com> | 2013-07-26 10:20:38 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2013-07-26 10:20:38 +0100 |
commit | 58e6fbe4ee35d65e14b626c557d37565bf8ad179 (patch) | |
tree | 8cf095f4f552a47efa4566d1983574e75bc85595 /android_webview/browser | |
parent | 0e2fcb857cf4c6230fc3aa213f6a0b0b4f644fd0 (diff) | |
download | chromium_org-58e6fbe4ee35d65e14b626c557d37565bf8ad179.tar.gz |
Merge from Chromium at DEPS revision r213780
This commit was generated by merge_to_master.py.
Change-Id: I9cf93efc460166e8ae27c76302af9095b402a90e
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/browser_view_renderer.h | 6 | ||||
-rw-r--r-- | android_webview/browser/in_process_view_renderer.cc | 12 | ||||
-rw-r--r-- | android_webview/browser/in_process_view_renderer.h | 5 |
3 files changed, 15 insertions, 8 deletions
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h index bcbc61a28e..613b36a20e 100644 --- a/android_webview/browser/browser_view_renderer.h +++ b/android_webview/browser/browser_view_renderer.h @@ -90,11 +90,13 @@ class BrowserViewRenderer { // return value indicates nothing was or will be drawn. // |java_canvas| is the target of the draw. |is_hardware_canvas| indicates // a GL Draw maybe possible on this canvas. |scroll| if the view's current - // scroll offset. |clip| is the canvas's clip bounds. + // scroll offset. |clip| is the canvas's clip bounds. |visible_rect| is the + // intersection of the view size and the window in window coordinates. virtual bool OnDraw(jobject java_canvas, bool is_hardware_canvas, const gfx::Vector2d& scroll, - const gfx::Rect& clip) = 0; + const gfx::Rect& clip, + const gfx::Rect& visible_rect) = 0; // Called in response to a prior Client::RequestDrawGL() call. See // AwDrawGLInfo documentation for more details of the contract. virtual void DrawGL(AwDrawGLInfo* draw_info) = 0; diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc index 7b70cff1c8..dbb4c241a9 100644 --- a/android_webview/browser/in_process_view_renderer.cc +++ b/android_webview/browser/in_process_view_renderer.cc @@ -196,8 +196,10 @@ void InProcessViewRenderer::WebContentsGone() { bool InProcessViewRenderer::OnDraw(jobject java_canvas, bool is_hardware_canvas, const gfx::Vector2d& scroll, - const gfx::Rect& clip) { + const gfx::Rect& clip, + const gfx::Rect& visible_rect) { scroll_at_start_of_frame_ = scroll; + global_visible_rect_at_start_of_frame_ = visible_rect; if (is_hardware_canvas && attached_to_window_ && HardwareEnabled()) { // We should be performing a hardware draw here. If we don't have the // comositor yet or if RequestDrawGL fails, it means we failed this draw and @@ -589,10 +591,10 @@ void InProcessViewRenderer::EnsureContinuousInvalidation( AwDrawGLInfo* draw_info) { if (continuous_invalidate_ && !block_invalidates_) { if (draw_info) { - draw_info->dirty_left = draw_info->clip_left; - draw_info->dirty_top = draw_info->clip_top; - draw_info->dirty_right = draw_info->clip_right; - draw_info->dirty_bottom = draw_info->clip_bottom; + draw_info->dirty_left = global_visible_rect_at_start_of_frame_.x(); + draw_info->dirty_top = global_visible_rect_at_start_of_frame_.y(); + draw_info->dirty_right = global_visible_rect_at_start_of_frame_.right(); + draw_info->dirty_bottom = global_visible_rect_at_start_of_frame_.bottom(); draw_info->status_mask |= AwDrawGLInfo::kStatusMaskDraw; } else { client_->PostInvalidate(); diff --git a/android_webview/browser/in_process_view_renderer.h b/android_webview/browser/in_process_view_renderer.h index c949bde9b5..e4f6dd5029 100644 --- a/android_webview/browser/in_process_view_renderer.h +++ b/android_webview/browser/in_process_view_renderer.h @@ -40,7 +40,8 @@ class InProcessViewRenderer : public BrowserViewRenderer, virtual bool OnDraw(jobject java_canvas, bool is_hardware_canvas, const gfx::Vector2d& scroll_, - const gfx::Rect& clip) OVERRIDE; + const gfx::Rect& clip, + const gfx::Rect& visible_rect) OVERRIDE; virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; virtual void EnableOnNewPicture(bool enabled) OVERRIDE; @@ -115,6 +116,8 @@ class InProcessViewRenderer : public BrowserViewRenderer, // Not to be used between draw calls. EGLContext last_egl_context_; + gfx::Rect global_visible_rect_at_start_of_frame_; + // Last View scroll when View.onDraw() was called. gfx::Vector2d scroll_at_start_of_frame_; |