Skip to content

Commit

Permalink
Suppress the most noisy MSVC warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Dec 15, 2022
1 parent 2721364 commit 955516b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions patches/warn_SkEncodedOrigin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/include/codec/SkEncodedOrigin.h b/include/codec/SkEncodedOrigin.h
index 19d083672f..9f4923e147 100644
--- a/include/codec/SkEncodedOrigin.h
+++ b/include/codec/SkEncodedOrigin.h
@@ -29,7 +29,9 @@ enum SkEncodedOrigin {
* that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly
* oriented destination rectangle of [0, 0, w, h].
*/
-static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h) {
+static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int iw, int ih) {
+ SkScalar w = (SkScalar) iw;
+ SkScalar h = (SkScalar) ih;
switch (origin) {
case kTopLeft_SkEncodedOrigin: return SkMatrix::I();
case kTopRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, 1, 0, 0, 0, 1);
13 changes: 13 additions & 0 deletions patches/warn_SkMatrix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 03140760d6..ec7cd35923 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -86,7 +86,7 @@ public:
return m;
}
static SkMatrix SK_WARN_UNUSED_RESULT Translate(SkVector t) { return Translate(t.x(), t.y()); }
- static SkMatrix SK_WARN_UNUSED_RESULT Translate(SkIVector t) { return Translate(t.x(), t.y()); }
+ static SkMatrix SK_WARN_UNUSED_RESULT Translate(SkIVector t) { return Translate((SkScalar) t.x(), (SkScalar) t.y()); }

/** Sets SkMatrix to rotate by |deg| about a pivot point at (0, 0).

0 comments on commit 955516b

Please sign in to comment.