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/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 582 |
583 window->CloseNow(); | 583 window->CloseNow(); |
584 } | 584 } |
585 #endif | 585 #endif |
586 | 586 |
587 //////////////////////////////////////////////////////////////////////////////// | 587 //////////////////////////////////////////////////////////////////////////////// |
588 // Painting | 588 // Painting |
589 //////////////////////////////////////////////////////////////////////////////// | 589 //////////////////////////////////////////////////////////////////////////////// |
590 | 590 |
591 void TestView::Paint(gfx::Canvas* canvas) { | 591 void TestView::Paint(gfx::Canvas* canvas) { |
592 canvas->AsCanvasSkia()->getClipBounds(&last_clip_); | 592 canvas->AsCanvasSkia()->skia_canvas()->getClipBounds(&last_clip_); |
593 } | 593 } |
594 | 594 |
595 void TestView::SchedulePaintInRect(const gfx::Rect& rect) { | 595 void TestView::SchedulePaintInRect(const gfx::Rect& rect) { |
596 scheduled_paint_rects_.push_back(rect); | 596 scheduled_paint_rects_.push_back(rect); |
597 View::SchedulePaintInRect(rect); | 597 View::SchedulePaintInRect(rect); |
598 } | 598 } |
599 | 599 |
600 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) { | 600 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) { |
601 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft); | 601 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft); |
602 EXPECT_EQ(target_rect.fRight, check_rect.fRight); | 602 EXPECT_EQ(target_rect.fRight, check_rect.fRight); |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 top_view->scheduled_paint_rects_.clear(); | 1934 top_view->scheduled_paint_rects_.clear(); |
1935 child_view->SetBounds(30, 30, 20, 20); | 1935 child_view->SetBounds(30, 30, 20, 20); |
1936 EXPECT_EQ(2U, top_view->scheduled_paint_rects_.size()); | 1936 EXPECT_EQ(2U, top_view->scheduled_paint_rects_.size()); |
1937 | 1937 |
1938 // There should be 2 rects, spanning from (10, 10) to (50, 50). | 1938 // There should be 2 rects, spanning from (10, 10) to (50, 50). |
1939 gfx::Rect paint_rect = | 1939 gfx::Rect paint_rect = |
1940 top_view->scheduled_paint_rects_[0].Union( | 1940 top_view->scheduled_paint_rects_[0].Union( |
1941 top_view->scheduled_paint_rects_[1]); | 1941 top_view->scheduled_paint_rects_[1]); |
1942 EXPECT_EQ(gfx::Rect(10, 10, 40, 40), paint_rect); | 1942 EXPECT_EQ(gfx::Rect(10, 10, 40, 40), paint_rect); |
1943 } | 1943 } |
OLD | NEW |