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

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

Issue 15002007: Delegate root layer scroll offset to android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of Jared's CL Created 7 years, 6 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
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/public/browser/draw_gl.h" 9 #include "android_webview/public/browser/draw_gl.h"
10 #include "android_webview/public/browser/draw_sw.h" 10 #include "android_webview/public/browser/draw_sw.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 550
551 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) { 551 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) {
552 if (continuous_invalidate_ == invalidate) 552 if (continuous_invalidate_ == invalidate)
553 return; 553 return;
554 554
555 continuous_invalidate_ = invalidate; 555 continuous_invalidate_ = invalidate;
556 // TODO(boliu): Handle if not attached to window case. 556 // TODO(boliu): Handle if not attached to window case.
557 EnsureContinuousInvalidation(); 557 EnsureContinuousInvalidation();
558 } 558 }
559 559
560 void InProcessViewRenderer::SetTotalRootLayerScrollOffset(
561 gfx::Vector2dF new_value) {
562 // TODO(mkosiba): Plumb this all the way through to the view.
563 root_layer_scroll_offset_ = new_value;
564 }
565
566 gfx::Vector2dF InProcessViewRenderer::GetTotalRootLayerScrollOffset() {
567 return root_layer_scroll_offset_;
568 }
569
560 void InProcessViewRenderer::Invalidate() { 570 void InProcessViewRenderer::Invalidate() {
561 continuous_invalidate_task_pending_ = false; 571 continuous_invalidate_task_pending_ = false;
562 if (continuous_invalidate_) 572 if (continuous_invalidate_)
563 client_->Invalidate(); 573 client_->Invalidate();
564 } 574 }
565 575
566 void InProcessViewRenderer::EnsureContinuousInvalidation() { 576 void InProcessViewRenderer::EnsureContinuousInvalidation() {
567 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { 577 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) {
568 base::MessageLoop::current()->PostTask(FROM_HERE, 578 base::MessageLoop::current()->PostTask(FROM_HERE,
569 base::Bind(&InProcessViewRenderer::Invalidate, 579 base::Bind(&InProcessViewRenderer::Invalidate,
570 weak_factory_.GetWeakPtr())); 580 weak_factory_.GetWeakPtr()));
571 continuous_invalidate_task_pending_ = true; 581 continuous_invalidate_task_pending_ = true;
572 } 582 }
573 } 583 }
574 584
575 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { 585 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) {
576 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page 586 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page
577 // scale here. Determine what if any needs bringing over to this class. 587 // scale here. Determine what if any needs bringing over to this class.
578 return CompositeSW(canvas); 588 return CompositeSW(canvas);
579 } 589 }
580 590
581 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { 591 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) {
582 return compositor_ && compositor_->DemandDrawSw(canvas); 592 return compositor_ && compositor_->DemandDrawSw(canvas);
583 } 593 }
584 594
585 } // namespace android_webview 595 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698