| OLD | NEW |
| 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 "ui/gfx/transform_skia.h" | 5 #include "ui/gfx/transform_skia.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkMatrix.h" | 7 #include "third_party/skia/include/core/SkMatrix.h" |
| 8 #include "ui/gfx/canvas_skia.h" | 8 #include "ui/gfx/canvas_skia.h" |
| 9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/point.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 bool TransformSkia::TransformRect(gfx::Rect* rect) { | 95 bool TransformSkia::TransformRect(gfx::Rect* rect) { |
| 96 SkRect src = gfx::RectToSkRect(*rect); | 96 SkRect src = gfx::RectToSkRect(*rect); |
| 97 if (!matrix_->mapRect(&src)) | 97 if (!matrix_->mapRect(&src)) |
| 98 return false; | 98 return false; |
| 99 gfx::Rect xrect = gfx::SkRectToRect(src); | 99 gfx::Rect xrect = gfx::SkRectToRect(src); |
| 100 rect->SetRect(xrect.x(), xrect.y(), xrect.width(), xrect.height()); | 100 rect->SetRect(xrect.x(), xrect.y(), xrect.width(), xrect.height()); |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void TransformSkia::Copy(const Transform& transform) { |
| 105 *matrix_ = *(static_cast<const TransformSkia&>(transform).matrix_); |
| 106 } |
| 107 |
| 104 } // namespace ui | 108 } // namespace ui |
| OLD | NEW |