| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 | 609 |
| 610 void Compositor::ScheduleFullRedraw() { | 610 void Compositor::ScheduleFullRedraw() { |
| 611 host_->SetNeedsRedraw(); | 611 host_->SetNeedsRedraw(); |
| 612 } | 612 } |
| 613 | 613 |
| 614 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { | 614 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { |
| 615 host_->SetNeedsRedrawRect(damage_rect); | 615 host_->SetNeedsRedrawRect(damage_rect); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { |
| 619 host_->SetLatencyInfo(latency_info); |
| 620 } |
| 621 |
| 618 bool Compositor::ReadPixels(SkBitmap* bitmap, | 622 bool Compositor::ReadPixels(SkBitmap* bitmap, |
| 619 const gfx::Rect& bounds_in_pixel) { | 623 const gfx::Rect& bounds_in_pixel) { |
| 620 if (bounds_in_pixel.right() > size().width() || | 624 if (bounds_in_pixel.right() > size().width() || |
| 621 bounds_in_pixel.bottom() > size().height()) | 625 bounds_in_pixel.bottom() > size().height()) |
| 622 return false; | 626 return false; |
| 623 bitmap->setConfig(SkBitmap::kARGB_8888_Config, | 627 bitmap->setConfig(SkBitmap::kARGB_8888_Config, |
| 624 bounds_in_pixel.width(), bounds_in_pixel.height()); | 628 bounds_in_pixel.width(), bounds_in_pixel.height()); |
| 625 bitmap->allocPixels(); | 629 bitmap->allocPixels(); |
| 626 SkAutoLockPixels lock_image(*bitmap); | 630 SkAutoLockPixels lock_image(*bitmap); |
| 627 unsigned char* pixels = static_cast<unsigned char*>(bitmap->getPixels()); | 631 unsigned char* pixels = static_cast<unsigned char*>(bitmap->getPixels()); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 COMPOSITOR_EXPORT void DisableTestCompositor() { | 819 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 816 ResetImplicitFactory(); | 820 ResetImplicitFactory(); |
| 817 g_test_compositor_enabled = false; | 821 g_test_compositor_enabled = false; |
| 818 } | 822 } |
| 819 | 823 |
| 820 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 824 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 821 return g_test_compositor_enabled; | 825 return g_test_compositor_enabled; |
| 822 } | 826 } |
| 823 | 827 |
| 824 } // namespace ui | 828 } // namespace ui |
| OLD | NEW |