aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-01-27 06:41:55 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-01-27 06:41:55 +0000
commit44e0abc61bb1d9cb22b31d75abd4d5176f222946 (patch)
tree86dc0093c13ad4d6e58f5cb24f64487972f50cd4
parent0059b28a0b54c46e43673608d51b74f76b1ec475 (diff)
parentf1b281a8816d180bd5f59cc72a3b98b17ce2dc2d (diff)
downloadskia-android-s-v2-beta-3.tar.gz
* changes: Fix Clang warning -Wbitwise-instead-of-logical. Fix Wbitwise-instead-of-logical warnings
-rw-r--r--modules/skottie/src/animator/Vec2KeyframeAnimator.cpp5
-rw-r--r--modules/skottie/src/animator/VectorKeyframeAnimator.cpp7
-rw-r--r--modules/svg/src/SkSVGPattern.cpp6
-rw-r--r--src/core/SkColorFilter.cpp2
-rw-r--r--src/core/SkPathEffect.cpp7
5 files changed, 15 insertions, 12 deletions
diff --git a/modules/skottie/src/animator/Vec2KeyframeAnimator.cpp b/modules/skottie/src/animator/Vec2KeyframeAnimator.cpp
index 1eee3d580f..b854f44cfd 100644
--- a/modules/skottie/src/animator/Vec2KeyframeAnimator.cpp
+++ b/modules/skottie/src/animator/Vec2KeyframeAnimator.cpp
@@ -223,8 +223,9 @@ bool AnimatablePropertyContainer::bindAutoOrientable(const AnimationBuilder& abu
}
// Separate-dimensions vector value: each component is animated independently.
- return this->bind(abuilder, (*jprop)["x"], &v->x)
- | this->bind(abuilder, (*jprop)["y"], &v->y);
+ bool boundX = this->bind(abuilder, (*jprop)["x"], &v->x);
+ bool boundY = this->bind(abuilder, (*jprop)["y"], &v->y);
+ return boundX || boundY;
}
template <>
diff --git a/modules/skottie/src/animator/VectorKeyframeAnimator.cpp b/modules/skottie/src/animator/VectorKeyframeAnimator.cpp
index a591c36d60..62e2a955a4 100644
--- a/modules/skottie/src/animator/VectorKeyframeAnimator.cpp
+++ b/modules/skottie/src/animator/VectorKeyframeAnimator.cpp
@@ -256,9 +256,10 @@ bool AnimatablePropertyContainer::bind<VectorValue>(const AnimationBuilder& abui
// Separate-dimensions vector value: each component is animated independently.
*v = { 0, 0, 0 };
- return this->bind(abuilder, (*jprop)["x"], v->data() + 0)
- | this->bind(abuilder, (*jprop)["y"], v->data() + 1)
- | this->bind(abuilder, (*jprop)["z"], v->data() + 2);
+ bool boundX = this->bind(abuilder, (*jprop)["x"], v->data() + 0);
+ bool boundY = this->bind(abuilder, (*jprop)["y"], v->data() + 1);
+ bool boundZ = this->bind(abuilder, (*jprop)["z"], v->data() + 2);
+ return boundX || boundY || boundZ;
}
} // namespace internal
diff --git a/modules/svg/src/SkSVGPattern.cpp b/modules/svg/src/SkSVGPattern.cpp
index e0496d890a..3a885c2107 100644
--- a/modules/svg/src/SkSVGPattern.cpp
+++ b/modules/svg/src/SkSVGPattern.cpp
@@ -39,13 +39,13 @@ const SkSVGPattern* SkSVGPattern::hrefTarget(const SkSVGRenderContext& ctx) cons
}
template <typename T>
-bool inherit_if_needed(const SkTLazy<T>& src, SkTLazy<T>& dst) {
+int inherit_if_needed(const SkTLazy<T>& src, SkTLazy<T>& dst) {
if (!dst.isValid()) {
dst = src;
- return true;
+ return 1;
}
- return false;
+ return 0;
}
/* https://www.w3.org/TR/SVG11/pservers.html#PatternElementHrefAttribute
diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp
index 87f4f27a4f..37a0b9ec8e 100644
--- a/src/core/SkColorFilter.cpp
+++ b/src/core/SkColorFilter.cpp
@@ -137,7 +137,7 @@ class SkComposeColorFilter : public SkColorFilterBase {
public:
bool onIsAlphaUnchanged() const override {
// Can only claim alphaunchanged support if both our proxys do.
- return fOuter->isAlphaUnchanged() & fInner->isAlphaUnchanged();
+ return fOuter->isAlphaUnchanged() && fInner->isAlphaUnchanged();
}
bool onAppendStages(const SkStageRec& rec, bool shaderIsOpaque) const override {
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp
index a14c1bf634..58aa5d384e 100644
--- a/src/core/SkPathEffect.cpp
+++ b/src/core/SkPathEffect.cpp
@@ -159,9 +159,10 @@ protected:
bool onFilterPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec,
const SkRect* cullRect) const override {
- // use bit-or so that we always call both, even if the first one succeeds
- return fPE0->filterPath(dst, src, rec, cullRect) |
- fPE1->filterPath(dst, src, rec, cullRect);
+ // always call both, even if the first one succeeds
+ bool filteredFirst = fPE0->filterPath(dst, src, rec, cullRect);
+ bool filteredSecond = fPE1->filterPath(dst, src, rec, cullRect);
+ return filteredFirst || filteredSecond;
}
private: