| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2338 void TestTexture::SetCanvas(const SkCanvas& canvas, | 2338 void TestTexture::SetCanvas(const SkCanvas& canvas, |
| 2339 const gfx::Point& origin, | 2339 const gfx::Point& origin, |
| 2340 const gfx::Size& overall_size) { | 2340 const gfx::Size& overall_size) { |
| 2341 const SkBitmap& bitmap = canvas.getDevice()->accessBitmap(false); | 2341 const SkBitmap& bitmap = canvas.getDevice()->accessBitmap(false); |
| 2342 bounds_of_last_paint_.SetRect( | 2342 bounds_of_last_paint_.SetRect( |
| 2343 origin.x(), origin.y(), bitmap.width(), bitmap.height()); | 2343 origin.x(), origin.y(), bitmap.width(), bitmap.height()); |
| 2344 } | 2344 } |
| 2345 | 2345 |
| 2346 class TestCompositor : public ui::Compositor { | 2346 class TestCompositor : public ui::Compositor { |
| 2347 public: | 2347 public: |
| 2348 TestCompositor() : Compositor(gfx::Size(100, 100)) {} | 2348 TestCompositor() : Compositor(NULL, gfx::Size(100, 100)) {} |
| 2349 | 2349 |
| 2350 // ui::Compositor: | 2350 // ui::Compositor: |
| 2351 virtual ui::Texture* CreateTexture() OVERRIDE { | 2351 virtual ui::Texture* CreateTexture() OVERRIDE { |
| 2352 return new TestTexture(); | 2352 return new TestTexture(); |
| 2353 } | 2353 } |
| 2354 virtual void NotifyStart() OVERRIDE {} | 2354 virtual void OnNotifyStart() OVERRIDE {} |
| 2355 virtual void NotifyEnd() OVERRIDE {} | 2355 virtual void OnNotifyEnd() OVERRIDE {} |
| 2356 virtual void Blur(const gfx::Rect& bounds) OVERRIDE {} | 2356 virtual void Blur(const gfx::Rect& bounds) OVERRIDE {} |
| 2357 virtual void SchedulePaint() OVERRIDE {} | |
| 2358 | 2357 |
| 2359 protected: | 2358 protected: |
| 2360 virtual void OnWidgetSizeChanged() OVERRIDE {} | 2359 virtual void OnWidgetSizeChanged() OVERRIDE {} |
| 2361 | 2360 |
| 2362 private: | 2361 private: |
| 2363 DISALLOW_COPY_AND_ASSIGN(TestCompositor); | 2362 DISALLOW_COPY_AND_ASSIGN(TestCompositor); |
| 2364 }; | 2363 }; |
| 2365 | 2364 |
| 2366 static ui::Compositor* TestCreateCompositor() { | 2365 static ui::Compositor* TestCreateCompositor() { |
| 2367 return new TestCompositor(); | 2366 return new TestCompositor(); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2799 EXPECT_EQ(gfx::Rect(11, 22, 100, 200), widget_view_host->layer()->bounds()); | 2798 EXPECT_EQ(gfx::Rect(11, 22, 100, 200), widget_view_host->layer()->bounds()); |
| 2800 ASSERT_TRUE(child_view->layer() != NULL); | 2799 ASSERT_TRUE(child_view->layer() != NULL); |
| 2801 EXPECT_EQ(gfx::Rect(5, 6, 10, 11), child_view->layer()->bounds()); | 2800 EXPECT_EQ(gfx::Rect(5, 6, 10, 11), child_view->layer()->bounds()); |
| 2802 | 2801 |
| 2803 child_widget->CloseNow(); | 2802 child_widget->CloseNow(); |
| 2804 } | 2803 } |
| 2805 | 2804 |
| 2806 #endif // VIEWS_COMPOSITOR | 2805 #endif // VIEWS_COMPOSITOR |
| 2807 | 2806 |
| 2808 } // namespace views | 2807 } // namespace views |
| OLD | NEW |