| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CC_PLAYBACK_DRAW_IMAGE_H_ | 5 #ifndef CC_PLAYBACK_DRAW_IMAGE_H_ |
| 6 #define CC_PLAYBACK_DRAW_IMAGE_H_ | 6 #define CC_PLAYBACK_DRAW_IMAGE_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "third_party/skia/include/core/SkFilterQuality.h" | 9 #include "third_party/skia/include/core/SkFilterQuality.h" |
| 10 #include "third_party/skia/include/core/SkImage.h" | 10 #include "third_party/skia/include/core/SkImage.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 DrawImage(const DrawImage& other); | 27 DrawImage(const DrawImage& other); |
| 28 ~DrawImage(); | 28 ~DrawImage(); |
| 29 | 29 |
| 30 const sk_sp<const SkImage>& image() const { return image_; } | 30 const sk_sp<const SkImage>& image() const { return image_; } |
| 31 const SkSize& scale() const { return scale_; } | 31 const SkSize& scale() const { return scale_; } |
| 32 const SkIRect src_rect() const { return src_rect_; } | 32 const SkIRect src_rect() const { return src_rect_; } |
| 33 SkFilterQuality filter_quality() const { return filter_quality_; } | 33 SkFilterQuality filter_quality() const { return filter_quality_; } |
| 34 bool matrix_is_decomposable() const { return matrix_is_decomposable_; } | 34 bool matrix_is_decomposable() const { return matrix_is_decomposable_; } |
| 35 const SkMatrix& matrix() const { return matrix_; } | 35 const SkMatrix& matrix() const { return matrix_; } |
| 36 | 36 |
| 37 DrawImage ApplyScale(const gfx::SizeF& scales) const { | 37 DrawImage ApplyScale(float scale) const { |
| 38 SkMatrix scaled_matrix = matrix_; | 38 SkMatrix scaled_matrix = matrix_; |
| 39 scaled_matrix.preScale(scales.width(), scales.height()); | 39 scaled_matrix.preScale(scale, scale); |
| 40 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix); | 40 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix); |
| 41 } | 41 } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 sk_sp<const SkImage> image_; | 44 sk_sp<const SkImage> image_; |
| 45 SkIRect src_rect_; | 45 SkIRect src_rect_; |
| 46 SkFilterQuality filter_quality_; | 46 SkFilterQuality filter_quality_; |
| 47 SkMatrix matrix_; | 47 SkMatrix matrix_; |
| 48 SkSize scale_; | 48 SkSize scale_; |
| 49 bool matrix_is_decomposable_; | 49 bool matrix_is_decomposable_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace cc | 52 } // namespace cc |
| 53 | 53 |
| 54 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ | 54 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ |
| OLD | NEW |