| 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 "ash/wm/image_grid.h" | 5 #include "ui/views/corewm/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/transform.h" | 14 #include "ui/gfx/transform.h" |
| 15 | 15 |
| 16 using std::max; | 16 using std::max; |
| 17 using std::min; | 17 using std::min; |
| 18 | 18 |
| 19 namespace ash { | 19 namespace views { |
| 20 namespace internal { | 20 namespace corewm { |
| 21 | 21 |
| 22 gfx::Rect ImageGrid::TestAPI::GetTransformedLayerBounds( | 22 gfx::Rect ImageGrid::TestAPI::GetTransformedLayerBounds( |
| 23 const ui::Layer& layer) { | 23 const ui::Layer& layer) { |
| 24 gfx::Rect bounds = layer.bounds(); | 24 gfx::Rect bounds = layer.bounds(); |
| 25 layer.transform().TransformRect(&bounds); | 25 layer.transform().TransformRect(&bounds); |
| 26 return bounds; | 26 return bounds; |
| 27 } | 27 } |
| 28 | 28 |
| 29 ImageGrid::ImageGrid() | 29 ImageGrid::ImageGrid() |
| 30 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)), | 30 : layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)), |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 const gfx::Size size = GetImageSize(image); | 272 const gfx::Size size = GetImageSize(image); |
| 273 layer_ptr->get()->SetBounds(gfx::Rect(0, 0, size.width(), size.height())); | 273 layer_ptr->get()->SetBounds(gfx::Rect(0, 0, size.width(), size.height())); |
| 274 | 274 |
| 275 painter_ptr->reset(new ImagePainter(image)); | 275 painter_ptr->reset(new ImagePainter(image)); |
| 276 layer_ptr->get()->set_delegate(painter_ptr->get()); | 276 layer_ptr->get()->set_delegate(painter_ptr->get()); |
| 277 layer_ptr->get()->SetFillsBoundsOpaquely(false); | 277 layer_ptr->get()->SetFillsBoundsOpaquely(false); |
| 278 layer_ptr->get()->SetVisible(true); | 278 layer_ptr->get()->SetVisible(true); |
| 279 layer_->Add(layer_ptr->get()); | 279 layer_->Add(layer_ptr->get()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace internal | 282 } // namespace corewm |
| 283 } // namespace ash | 283 } // namespace views |
| OLD | NEW |