| 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/gfx/skia_util.h" | 5 #include "ui/gfx/skia_util.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkBitmap.h" | 7 #include "third_party/skia/include/core/SkBitmap.h" |
| 8 #include "third_party/skia/include/core/SkColorFilter.h" | 8 #include "third_party/skia/include/core/SkColorFilter.h" |
| 9 #include "third_party/skia/include/core/SkColorPriv.h" | 9 #include "third_party/skia/include/core/SkColorPriv.h" |
| 10 #include "third_party/skia/include/core/SkUnPreMultiply.h" | 10 #include "third_party/skia/include/core/SkUnPreMultiply.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 SkRect RectToSkRect(const Rect& rect) { | 22 SkRect RectToSkRect(const Rect& rect) { |
| 23 SkRect r; | 23 SkRect r; |
| 24 r.iset(rect.x(), rect.y(), rect.right(), rect.bottom()); | 24 r.iset(rect.x(), rect.y(), rect.right(), rect.bottom()); |
| 25 return r; | 25 return r; |
| 26 } | 26 } |
| 27 | 27 |
| 28 SkIRect RectToSkIRect(const Rect& rect) { | 28 SkIRect RectToSkIRect(const Rect& rect) { |
| 29 return SkIRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()); | 29 return SkIRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 SkIRect RectToSkIRect(const RectF& rect) { |
| 33 return SkIRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()); |
| 34 } |
| 35 |
| 32 Rect SkIRectToRect(const SkIRect& rect) { | 36 Rect SkIRectToRect(const SkIRect& rect) { |
| 33 return Rect(rect.x(), rect.y(), rect.width(), rect.height()); | 37 return Rect(rect.x(), rect.y(), rect.width(), rect.height()); |
| 34 } | 38 } |
| 35 | 39 |
| 36 SkRect RectFToSkRect(const RectF& rect) { | 40 SkRect RectFToSkRect(const RectF& rect) { |
| 37 return SkRect::MakeXYWH(SkFloatToScalar(rect.x()), | 41 return SkRect::MakeXYWH(SkFloatToScalar(rect.x()), |
| 38 SkFloatToScalar(rect.y()), | 42 SkFloatToScalar(rect.y()), |
| 39 SkFloatToScalar(rect.width()), | 43 SkFloatToScalar(rect.width()), |
| 40 SkFloatToScalar(rect.height())); | 44 SkFloatToScalar(rect.height())); |
| 41 } | 45 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } else { | 178 } else { |
| 175 rgba[i + 0] = SkGetPackedR32(pixel_in); | 179 rgba[i + 0] = SkGetPackedR32(pixel_in); |
| 176 rgba[i + 1] = SkGetPackedG32(pixel_in); | 180 rgba[i + 1] = SkGetPackedG32(pixel_in); |
| 177 rgba[i + 2] = SkGetPackedB32(pixel_in); | 181 rgba[i + 2] = SkGetPackedB32(pixel_in); |
| 178 rgba[i + 3] = alpha; | 182 rgba[i + 3] = alpha; |
| 179 } | 183 } |
| 180 } | 184 } |
| 181 } | 185 } |
| 182 | 186 |
| 183 } // namespace gfx | 187 } // namespace gfx |
| OLD | NEW |