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

Side by Side Diff: ash/wm/image_grid.cc

Issue 11359172: ui: Remove implicit flooring in skia rect conversion methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make root window transform in tests produce an integer result 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/image_grid.h ('k') | ash/wm/image_grid_unittest.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) 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 "ash/wm/image_grid.h" 5 #include "ash/wm/image_grid.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "third_party/skia/include/core/SkXfermode.h" 10 #include "third_party/skia/include/core/SkXfermode.h"
11 #include "ui/gfx/canvas.h" 11 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/image/image.h" 12 #include "ui/gfx/image/image.h"
13 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/rect_conversions.h"
14 #include "ui/gfx/transform.h" 15 #include "ui/gfx/transform.h"
15 16
16 using std::max; 17 using std::max;
17 using std::min; 18 using std::min;
18 19
19 namespace ash { 20 namespace ash {
20 namespace internal { 21 namespace internal {
21 22
22 gfx::Rect ImageGrid::TestAPI::GetTransformedLayerBounds( 23 gfx::RectF ImageGrid::TestAPI::GetTransformedLayerBounds(
23 const ui::Layer& layer) { 24 const ui::Layer& layer) {
24 gfx::Rect bounds = layer.bounds(); 25 gfx::RectF bounds = layer.bounds();
25 layer.transform().TransformRect(&bounds); 26 layer.transform().TransformRect(&bounds);
26 return bounds; 27 return bounds;
27 } 28 }
28 29
29 ImageGrid::ImageGrid() 30 ImageGrid::ImageGrid()
30 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)), 31 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)),
31 top_image_height_(0), 32 top_image_height_(0),
32 bottom_image_height_(0), 33 bottom_image_height_(0),
33 left_image_width_(0), 34 left_image_width_(0),
34 right_image_width_(0), 35 right_image_width_(0),
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 275
275 painter_ptr->reset(new ImagePainter(image)); 276 painter_ptr->reset(new ImagePainter(image));
276 layer_ptr->get()->set_delegate(painter_ptr->get()); 277 layer_ptr->get()->set_delegate(painter_ptr->get());
277 layer_ptr->get()->SetFillsBoundsOpaquely(false); 278 layer_ptr->get()->SetFillsBoundsOpaquely(false);
278 layer_ptr->get()->SetVisible(true); 279 layer_ptr->get()->SetVisible(true);
279 layer_->Add(layer_ptr->get()); 280 layer_->Add(layer_ptr->get());
280 } 281 }
281 282
282 } // namespace internal 283 } // namespace internal
283 } // namespace ash 284 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/image_grid.h ('k') | ash/wm/image_grid_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698