| OLD | NEW |
| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 562 |
| 563 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) { | 563 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) { |
| 564 if (continuous_invalidate_ == invalidate) | 564 if (continuous_invalidate_ == invalidate) |
| 565 return; | 565 return; |
| 566 | 566 |
| 567 continuous_invalidate_ = invalidate; | 567 continuous_invalidate_ = invalidate; |
| 568 // TODO(boliu): Handle if not attached to window case. | 568 // TODO(boliu): Handle if not attached to window case. |
| 569 EnsureContinuousInvalidation(); | 569 EnsureContinuousInvalidation(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void InProcessViewRenderer::SetTotalRootLayerScrollOffset( |
| 573 gfx::Vector2dF new_value) { |
| 574 // TODO(mkosiba): Plumb this all the way through to the view. |
| 575 scroll_offset_ = new_value; |
| 576 } |
| 577 |
| 578 gfx::Vector2dF InProcessViewRenderer::GetTotalRootLayerScrollOffset() { |
| 579 return scroll_offset_; |
| 580 } |
| 581 |
| 572 void InProcessViewRenderer::Invalidate() { | 582 void InProcessViewRenderer::Invalidate() { |
| 573 continuous_invalidate_task_pending_ = false; | 583 continuous_invalidate_task_pending_ = false; |
| 574 if (continuous_invalidate_) | 584 if (continuous_invalidate_) |
| 575 client_->Invalidate(); | 585 client_->Invalidate(); |
| 576 } | 586 } |
| 577 | 587 |
| 578 void InProcessViewRenderer::EnsureContinuousInvalidation() { | 588 void InProcessViewRenderer::EnsureContinuousInvalidation() { |
| 579 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { | 589 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { |
| 580 base::MessageLoop::current()->PostTask(FROM_HERE, | 590 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 581 base::Bind(&InProcessViewRenderer::Invalidate, | 591 base::Bind(&InProcessViewRenderer::Invalidate, |
| 582 weak_factory_.GetWeakPtr())); | 592 weak_factory_.GetWeakPtr())); |
| 583 continuous_invalidate_task_pending_ = true; | 593 continuous_invalidate_task_pending_ = true; |
| 584 } | 594 } |
| 585 } | 595 } |
| 586 | 596 |
| 587 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { | 597 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { |
| 588 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page | 598 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page |
| 589 // scale here. Determine what if any needs bringing over to this class. | 599 // scale here. Determine what if any needs bringing over to this class. |
| 590 return CompositeSW(canvas); | 600 return CompositeSW(canvas); |
| 591 } | 601 } |
| 592 | 602 |
| 593 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { | 603 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { |
| 594 return compositor_ && compositor_->DemandDrawSw(canvas); | 604 return compositor_ && compositor_->DemandDrawSw(canvas); |
| 595 } | 605 } |
| 596 | 606 |
| 597 } // namespace android_webview | 607 } // namespace android_webview |
| OLD | NEW |