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