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 #include "cc/playback/draw_image.h" | 5 #include "cc/paint/draw_image.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 namespace { | 8 namespace { |
9 | 9 |
10 // Helper funciton to extract a scale from the matrix. Returns true on success | 10 // Helper funciton to extract a scale from the matrix. Returns true on success |
11 // and false on failure. | 11 // and false on failure. |
12 bool ExtractScale(const SkMatrix& matrix, SkSize* scale) { | 12 bool ExtractScale(const SkMatrix& matrix, SkSize* scale) { |
13 *scale = SkSize::Make(matrix.getScaleX(), matrix.getScaleY()); | 13 *scale = SkSize::Make(matrix.getScaleX(), matrix.getScaleY()); |
14 if (matrix.getType() & SkMatrix::kAffine_Mask) { | 14 if (matrix.getType() & SkMatrix::kAffine_Mask) { |
15 if (!matrix.decomposeScale(scale)) { | 15 if (!matrix.decomposeScale(scale)) { |
(...skipping 23 matching lines...) Expand all Loading... |
39 filter_quality_(filter_quality), | 39 filter_quality_(filter_quality), |
40 matrix_(matrix) { | 40 matrix_(matrix) { |
41 matrix_is_decomposable_ = ExtractScale(matrix_, &scale_); | 41 matrix_is_decomposable_ = ExtractScale(matrix_, &scale_); |
42 } | 42 } |
43 | 43 |
44 DrawImage::DrawImage(const DrawImage& other) = default; | 44 DrawImage::DrawImage(const DrawImage& other) = default; |
45 | 45 |
46 DrawImage::~DrawImage() = default; | 46 DrawImage::~DrawImage() = default; |
47 | 47 |
48 } // namespace cc | 48 } // namespace cc |
OLD | NEW |