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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 11275089: SkRect to gfx::Rect type conversions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove unnecessary lines Created 8 years, 1 month 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
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 private: 1043 private:
1044 // Overridden from LayerDelegate: 1044 // Overridden from LayerDelegate:
1045 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { 1045 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
1046 paint_count_++; 1046 paint_count_++;
1047 if (!schedule_paint_rect_.IsEmpty()) { 1047 if (!schedule_paint_rect_.IsEmpty()) {
1048 layer_->SchedulePaint(schedule_paint_rect_); 1048 layer_->SchedulePaint(schedule_paint_rect_);
1049 schedule_paint_rect_ = gfx::Rect(); 1049 schedule_paint_rect_ = gfx::Rect();
1050 } 1050 }
1051 SkRect sk_clip_rect; 1051 SkRect sk_clip_rect;
1052 if (canvas->sk_canvas()->getClipBounds(&sk_clip_rect)) 1052 if (canvas->sk_canvas()->getClipBounds(&sk_clip_rect))
1053 last_clip_rect_ = gfx::SkRectToRect(sk_clip_rect); 1053 last_clip_rect_ = gfx::ToFlooredRectDeprecated(
danakj 2012/11/01 17:38:27 Tests check that the integer rect contains things,
1054 gfx::SkRectToRectF(sk_clip_rect));
1054 } 1055 }
1055 1056
1056 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE { 1057 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
1057 } 1058 }
1058 1059
1059 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE { 1060 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
1060 return base::Closure(); 1061 return base::Closure();
1061 } 1062 }
1062 1063
1063 int paint_count_; 1064 int paint_count_;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 1297
1297 // Resize layer. 1298 // Resize layer.
1298 child->SetBounds(gfx::Rect(200, 200, 400, 400)); 1299 child->SetBounds(gfx::Rect(200, 200, 400, 400));
1299 child->SetVisible(true); 1300 child->SetVisible(true);
1300 EXPECT_TRUE(schedule_draw_invoked_); 1301 EXPECT_TRUE(schedule_draw_invoked_);
1301 DrawTree(root.get()); 1302 DrawTree(root.get());
1302 EXPECT_TRUE(delegate.painted()); 1303 EXPECT_TRUE(delegate.painted());
1303 } 1304 }
1304 1305
1305 } // namespace ui 1306 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698