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 10 matching lines...) Expand all Loading... |
21 const SkIRect& src_rect, | 21 const SkIRect& src_rect, |
22 SkFilterQuality filter_quality, | 22 SkFilterQuality filter_quality, |
23 const SkMatrix& matrix); | 23 const SkMatrix& matrix); |
24 DrawImage(const DrawImage& other); | 24 DrawImage(const DrawImage& other); |
25 | 25 |
26 const SkImage* image() const { return image_; } | 26 const SkImage* image() const { return image_; } |
27 const SkSize& scale() const { return scale_; } | 27 const SkSize& scale() const { return scale_; } |
28 const SkIRect src_rect() const { return src_rect_; } | 28 const SkIRect src_rect() const { return src_rect_; } |
29 SkFilterQuality filter_quality() const { return filter_quality_; } | 29 SkFilterQuality filter_quality() const { return filter_quality_; } |
30 bool matrix_is_decomposable() const { return matrix_is_decomposable_; } | 30 bool matrix_is_decomposable() const { return matrix_is_decomposable_; } |
31 const SkMatrix& matrix() { return matrix_; } | 31 const SkMatrix& matrix() const { return matrix_; } |
32 | 32 |
33 DrawImage ApplyScale(float scale) const { | 33 DrawImage ApplyScale(float scale) const { |
34 SkMatrix scaled_matrix = matrix_; | 34 SkMatrix scaled_matrix = matrix_; |
35 scaled_matrix.postScale(scale, scale); | 35 scaled_matrix.postScale(scale, scale); |
36 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix); | 36 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 const SkImage* image_; | 40 const SkImage* image_; |
41 SkIRect src_rect_; | 41 SkIRect src_rect_; |
42 SkFilterQuality filter_quality_; | 42 SkFilterQuality filter_quality_; |
43 SkMatrix matrix_; | 43 SkMatrix matrix_; |
44 SkSize scale_; | 44 SkSize scale_; |
45 bool matrix_is_decomposable_; | 45 bool matrix_is_decomposable_; |
46 }; | 46 }; |
47 | 47 |
48 } // namespace cc | 48 } // namespace cc |
49 | 49 |
50 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ | 50 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ |
OLD | NEW |