| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "third_party/skia/include/effects/SkLayerRasterizer.h" | 29 #include "third_party/skia/include/effects/SkLayerRasterizer.h" |
| 30 #include "ui/gfx/rect_conversions.h" | 30 #include "ui/gfx/rect_conversions.h" |
| 31 #include "ui/gfx/skia_util.h" | 31 #include "ui/gfx/skia_util.h" |
| 32 #include "ui/gfx/transform.h" | 32 #include "ui/gfx/transform.h" |
| 33 | 33 |
| 34 namespace cc { | 34 namespace cc { |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 static inline bool IsScalarNearlyInteger(SkScalar scalar) { | 38 static inline bool IsScalarNearlyInteger(SkScalar scalar) { |
| 39 return SkScalarNearlyZero(scalar - SkScalarRound(scalar)); | 39 return SkScalarNearlyZero(scalar - SkScalarRoundToScalar(scalar)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool IsScaleAndIntegerTranslate(const SkMatrix& matrix) { | 42 bool IsScaleAndIntegerTranslate(const SkMatrix& matrix) { |
| 43 return IsScalarNearlyInteger(matrix[SkMatrix::kMTransX]) && | 43 return IsScalarNearlyInteger(matrix[SkMatrix::kMTransX]) && |
| 44 IsScalarNearlyInteger(matrix[SkMatrix::kMTransY]) && | 44 IsScalarNearlyInteger(matrix[SkMatrix::kMTransY]) && |
| 45 SkScalarNearlyZero(matrix[SkMatrix::kMSkewX]) && | 45 SkScalarNearlyZero(matrix[SkMatrix::kMSkewX]) && |
| 46 SkScalarNearlyZero(matrix[SkMatrix::kMSkewY]) && | 46 SkScalarNearlyZero(matrix[SkMatrix::kMSkewY]) && |
| 47 SkScalarNearlyZero(matrix[SkMatrix::kMPersp0]) && | 47 SkScalarNearlyZero(matrix[SkMatrix::kMPersp0]) && |
| 48 SkScalarNearlyZero(matrix[SkMatrix::kMPersp1]) && | 48 SkScalarNearlyZero(matrix[SkMatrix::kMPersp1]) && |
| 49 SkScalarNearlyZero(matrix[SkMatrix::kMPersp2] - 1.0f); | 49 SkScalarNearlyZero(matrix[SkMatrix::kMPersp2] - 1.0f); |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 return; | 602 return; |
| 603 visible_ = visible; | 603 visible_ = visible; |
| 604 | 604 |
| 605 if (visible_) | 605 if (visible_) |
| 606 EnsureBackbuffer(); | 606 EnsureBackbuffer(); |
| 607 else | 607 else |
| 608 DiscardBackbuffer(); | 608 DiscardBackbuffer(); |
| 609 } | 609 } |
| 610 | 610 |
| 611 } // namespace cc | 611 } // namespace cc |
| OLD | NEW |