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 if (continuous_invalidate_) | 419 if (continuous_invalidate_) |
410 client_->Invalidate(); | 420 client_->Invalidate(); |
411 } | 421 } |
412 | 422 |
413 void InProcessViewRenderer::EnsureContinuousInvalidation() { | 423 void InProcessViewRenderer::EnsureContinuousInvalidation() { |
414 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { | 424 if (continuous_invalidate_ && !continuous_invalidate_task_pending_) { |
415 MessageLoop::current()->PostTask(FROM_HERE, | 425 MessageLoop::current()->PostTask(FROM_HERE, |
416 base::Bind(&InProcessViewRenderer::Invalidate, | 426 base::Bind(&InProcessViewRenderer::Invalidate, |
417 weak_factory_.GetWeakPtr())); | 427 weak_factory_.GetWeakPtr())); |
418 continuous_invalidate_task_pending_ = true; | 428 continuous_invalidate_task_pending_ = true; |
419 } | 429 } |
420 } | 430 } |
421 | 431 |
422 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { | 432 bool InProcessViewRenderer::RenderSW(SkCanvas* canvas) { |
423 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page | 433 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page |
424 // scale here. Determine what if any needs bringing over to this class. | 434 // scale here. Determine what if any needs bringing over to this class. |
425 return CompositeSW(canvas); | 435 return CompositeSW(canvas); |
426 } | 436 } |
427 | 437 |
428 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { | 438 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { |
429 return compositor_ && compositor_->DemandDrawSw(canvas); | 439 return compositor_ && compositor_->DemandDrawSw(canvas); |
430 } | 440 } |
431 | 441 |
432 } // namespace android_webview | 442 } // namespace android_webview |
OLD | NEW |