diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-28 15:32:01 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-28 20:02:16 +0000 |
commit | 3416969605137214a9e1b1fb85182e5640a655ab (patch) | |
tree | 7b81edfaf359d2e50bab4ef3f2d27c38702da000 /include | |
parent | 5b071782585024bd75a203f3cde0429bfb7ec99d (diff) |
Revert "Revert "Revert "Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible""""
This reverts commit a184ac7e0cdb26919369151f606c194358c94ff5.
Change-Id: I2a4a1b713fd998ba33a5f85a34be1645438a7ac9
Reviewed-on: https://skia-review.googlesource.com/39400
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMatrix.h | 2 | ||||
-rw-r--r-- | include/core/SkScalar.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 746f176f4c..e6a957689e 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -80,6 +80,8 @@ public: return !(this->getType() & ~(kScale_Mask | kTranslate_Mask)); } + bool isTranslate() const { return !(this->getType() & ~(kTranslate_Mask)); } + /** Returns true if will map a rectangle to another rectangle. This can be true if the matrix is identity, scale-only, or rotates a multiple of 90 degrees, or mirrors in x or y. diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h index 2c409c407b..762adb4b53 100644 --- a/include/core/SkScalar.h +++ b/include/core/SkScalar.h @@ -146,7 +146,7 @@ static inline SkScalar SkMaxScalar(SkScalar a, SkScalar b) { return a > b ? a : static inline SkScalar SkMinScalar(SkScalar a, SkScalar b) { return a < b ? a : b; } static inline bool SkScalarIsInt(SkScalar x) { - return x == (SkScalar)(int)x; + return x == SkScalarFloorToScalar(x); } /** |