Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: views/view_unittest.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/painter.cc ('k') | views/widget/root_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « views/painter.cc ('k') | views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698