Use const where possible for drawing parameters
They should never be modified by a Renderer, only read and copied.
Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
diff --git a/libs/hwui/StatefulBaseRenderer.cpp b/libs/hwui/StatefulBaseRenderer.cpp
index 2932037..05f6cf8 100644
--- a/libs/hwui/StatefulBaseRenderer.cpp
+++ b/libs/hwui/StatefulBaseRenderer.cpp
@@ -114,7 +114,7 @@
mSnapshot->transform->skew(sx, sy);
}
-void StatefulBaseRenderer::setMatrix(SkMatrix* matrix) {
+void StatefulBaseRenderer::setMatrix(const SkMatrix* matrix) {
if (matrix) {
mSnapshot->transform->load(*matrix);
} else {
@@ -126,7 +126,7 @@
mSnapshot->transform->load(matrix);
}
-void StatefulBaseRenderer::concatMatrix(SkMatrix* matrix) {
+void StatefulBaseRenderer::concatMatrix(const SkMatrix* matrix) {
mat4 transform(*matrix);
mSnapshot->transform->multiply(transform);
}
@@ -151,7 +151,7 @@
return StatefulBaseRenderer::clipPath(&path, op);
}
-bool StatefulBaseRenderer::clipPath(SkPath* path, SkRegion::Op op) {
+bool StatefulBaseRenderer::clipPath(const SkPath* path, SkRegion::Op op) {
SkMatrix transform;
currentTransform()->copyTo(transform);
@@ -177,7 +177,7 @@
return !mSnapshot->clipRect->isEmpty();
}
-bool StatefulBaseRenderer::clipRegion(SkRegion* region, SkRegion::Op op) {
+bool StatefulBaseRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
mDirtyClip |= mSnapshot->clipRegionTransformed(*region, op);
return !mSnapshot->clipRect->isEmpty();
}