OLD | NEW |
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 "ui/wm/core/image_grid.h" | 5 #include "ui/wm/core/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" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Returns true if |layer|'s bounds don't fit within |size|. | 53 // Returns true if |layer|'s bounds don't fit within |size|. |
54 bool LayerExceedsSize(const ui::Layer* layer, const gfx::Size& size) { | 54 bool LayerExceedsSize(const ui::Layer* layer, const gfx::Size& size) { |
55 return layer->bounds().width() > size.width() || | 55 return layer->bounds().width() > size.width() || |
56 layer->bounds().height() > size.height(); | 56 layer->bounds().height() > size.height(); |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 gfx::RectF ImageGrid::TestAPI::GetTransformedLayerBounds( | 61 gfx::RectF ImageGrid::TestAPI::GetTransformedLayerBounds( |
62 const ui::Layer& layer) { | 62 const ui::Layer& layer) { |
63 gfx::RectF bounds = layer.bounds(); | 63 gfx::RectF bounds = gfx::RectF(layer.bounds()); |
64 layer.transform().TransformRect(&bounds); | 64 layer.transform().TransformRect(&bounds); |
65 return bounds; | 65 return bounds; |
66 } | 66 } |
67 | 67 |
68 ImageGrid::ImageGrid() | 68 ImageGrid::ImageGrid() |
69 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)), | 69 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)), |
70 top_image_height_(0), | 70 top_image_height_(0), |
71 bottom_image_height_(0), | 71 bottom_image_height_(0), |
72 left_image_width_(0), | 72 left_image_width_(0), |
73 right_image_width_(0), | 73 right_image_width_(0), |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 layer_ptr->get()->SetBounds(gfx::Rect(0, 0, size.width(), size.height())); | 336 layer_ptr->get()->SetBounds(gfx::Rect(0, 0, size.width(), size.height())); |
337 | 337 |
338 painter_ptr->reset(new ImagePainter(image_skia)); | 338 painter_ptr->reset(new ImagePainter(image_skia)); |
339 layer_ptr->get()->set_delegate(painter_ptr->get()); | 339 layer_ptr->get()->set_delegate(painter_ptr->get()); |
340 layer_ptr->get()->SetFillsBoundsOpaquely(false); | 340 layer_ptr->get()->SetFillsBoundsOpaquely(false); |
341 layer_ptr->get()->SetVisible(true); | 341 layer_ptr->get()->SetVisible(true); |
342 layer_->Add(layer_ptr->get()); | 342 layer_->Add(layer_ptr->get()); |
343 } | 343 } |
344 | 344 |
345 } // namespace wm | 345 } // namespace wm |
OLD | NEW |