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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 EXPECT_EQ(gm.previously_handled_flag_, false); | 393 EXPECT_EQ(gm.previously_handled_flag_, false); |
394 | 394 |
395 widget->CloseNow(); | 395 widget->CloseNow(); |
396 } | 396 } |
397 | 397 |
398 //////////////////////////////////////////////////////////////////////////////// | 398 //////////////////////////////////////////////////////////////////////////////// |
399 // Painting | 399 // Painting |
400 //////////////////////////////////////////////////////////////////////////////// | 400 //////////////////////////////////////////////////////////////////////////////// |
401 | 401 |
402 void TestView::Paint(gfx::Canvas* canvas) { | 402 void TestView::Paint(gfx::Canvas* canvas) { |
403 canvas->AsCanvasSkia()->getClipBounds(&last_clip_); | 403 canvas->GetSkCanvas()->getClipBounds(&last_clip_); |
404 } | 404 } |
405 | 405 |
406 void TestView::SchedulePaintInRect(const gfx::Rect& rect) { | 406 void TestView::SchedulePaintInRect(const gfx::Rect& rect) { |
407 scheduled_paint_rects_.push_back(rect); | 407 scheduled_paint_rects_.push_back(rect); |
408 View::SchedulePaintInRect(rect); | 408 View::SchedulePaintInRect(rect); |
409 } | 409 } |
410 | 410 |
411 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) { | 411 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) { |
412 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft); | 412 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft); |
413 EXPECT_EQ(target_rect.fRight, check_rect.fRight); | 413 EXPECT_EQ(target_rect.fRight, check_rect.fRight); |
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2799 // Make content_view have a dirty rect, paint the layers and make sure | 2799 // Make content_view have a dirty rect, paint the layers and make sure |
2800 // PaintTrackingView is painted. | 2800 // PaintTrackingView is painted. |
2801 content_view->layer()->SchedulePaint(gfx::Rect(0, 0, 10, 10)); | 2801 content_view->layer()->SchedulePaint(gfx::Rect(0, 0, 10, 10)); |
2802 GetRootLayer()->DrawTree(); | 2802 GetRootLayer()->DrawTree(); |
2803 EXPECT_TRUE(content_view->painted()); | 2803 EXPECT_TRUE(content_view->painted()); |
2804 } | 2804 } |
2805 | 2805 |
2806 #endif // VIEWS_COMPOSITOR | 2806 #endif // VIEWS_COMPOSITOR |
2807 | 2807 |
2808 } // namespace views | 2808 } // namespace views |
OLD | NEW |