| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_renderer/in_process_view_renderer.h
" | 5 #include "android_webview/browser/in_process_renderer/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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) { | 398 void InProcessViewRenderer::SetContinuousInvalidate(bool invalidate) { |
| 399 if (continuous_invalidate_ == invalidate) | 399 if (continuous_invalidate_ == invalidate) |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 continuous_invalidate_ = invalidate; | 402 continuous_invalidate_ = invalidate; |
| 403 // TODO(boliu): Handle if not attached to window case. | 403 // TODO(boliu): Handle if not attached to window case. |
| 404 EnsureContinuousInvalidation(); | 404 EnsureContinuousInvalidation(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 void InProcessViewRenderer::SetTotalRootLayerScrollOffset( |
| 408 gfx::Vector2dF new_value) { |
| 409 // TODO(mkosiba): Plumb this all the way through to the view. |
| 410 root_layer_scroll_offset_ = new_value; |
| 411 } |
| 412 |
| 413 gfx::Vector2dF InProcessViewRenderer::GetTotalRootLayerScrollOffset() { |
| 414 return root_layer_scroll_offset_; |
| 415 } |
| 416 |
| 407 void InProcessViewRenderer::Invalidate() { | 417 void InProcessViewRenderer::Invalidate() { |
| 408 continuous_invalidate_task_pending_ = false; | 418 continuous_invalidate_task_pending_ = false; |
| 409 client_->Invalidate(); | 419 client_->Invalidate(); |
| 410 } | 420 } |
| 411 | 421 |
| 412 void InProcessViewRenderer::EnsureContinuousInvalidation() { | 422 void InProcessViewRenderer::EnsureContinuousInvalidation() { |
| 413 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { | 423 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { |
| 414 MessageLoop::current()->PostTask(FROM_HERE, | 424 MessageLoop::current()->PostTask(FROM_HERE, |
| 415 base::Bind(&InProcessViewRenderer::Invalidate, | 425 base::Bind(&InProcessViewRenderer::Invalidate, |
| 416 weak_factory_.GetWeakPtr())); | 426 weak_factory_.GetWeakPtr())); |
| 417 continuous_invalidate_task_pending_ = true; | 427 continuous_invalidate_task_pending_ = true; |
| 418 } | 428 } |
| 419 } | 429 } |
| 420 | 430 |
| 421 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { | 431 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { |
| 422 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page | 432 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page |
| 423 // scale here. Determine what if any needs bringing over to this class. | 433 // scale here. Determine what if any needs bringing over to this class. |
| 424 return CompositeSW(canvas); | 434 return CompositeSW(canvas); |
| 425 } | 435 } |
| 426 | 436 |
| 427 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { | 437 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { |
| 428 return compositor_ && compositor_->DemandDrawSw(canvas); | 438 return compositor_ && compositor_->DemandDrawSw(canvas); |
| 429 } | 439 } |
| 430 | 440 |
| 431 } // namespace android_webview | 441 } // namespace android_webview |
| OLD | NEW |