aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkCanvas.cpp16
-rw-r--r--src/core/SkGeometry.cpp1
-rw-r--r--src/core/SkPicturePlayback.cpp23
-rw-r--r--src/effects/SkArithmeticMode.cpp2
-rw-r--r--src/effects/SkColorMatrixFilter.cpp5
5 files changed, 22 insertions, 25 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index a1d3826efd..13bc718a33 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -978,9 +978,9 @@ void SkCanvas::internalDrawDevice(SkDevice* srcDev, int x, int y,
SkBitmap dst;
const SkBitmap& src = srcDev->accessBitmap(false);
if (filter->filterImage(&proxy, src, *iter.fMatrix, &dst, &pos)) {
- SkPaint tmp(*paint);
- tmp.setImageFilter(NULL);
- dstDev->drawSprite(iter, dst, pos.x(), pos.y(), tmp);
+ SkPaint tmpUnfiltered(*paint);
+ tmpUnfiltered.setImageFilter(NULL);
+ dstDev->drawSprite(iter, dst, pos.x(), pos.y(), tmpUnfiltered);
}
} else {
dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint);
@@ -1011,10 +1011,12 @@ void SkCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
if (filter && !iter.fDevice->canHandleImageFilter(filter)) {
DeviceImageFilterProxy proxy(iter.fDevice);
SkBitmap dst;
- if (filter->filterImage(&proxy, bitmap, *iter.fMatrix, &dst, &pos)) {
- SkPaint tmp(*paint);
- tmp.setImageFilter(NULL);
- iter.fDevice->drawSprite(iter, dst, pos.x(), pos.y(), tmp);
+ if (filter->filterImage(&proxy, bitmap, *iter.fMatrix,
+ &dst, &pos)) {
+ SkPaint tmpUnfiltered(*paint);
+ tmpUnfiltered.setImageFilter(NULL);
+ iter.fDevice->drawSprite(iter, dst, pos.x(), pos.y(),
+ tmpUnfiltered);
}
} else {
iter.fDevice->drawSprite(iter, bitmap, pos.x(), pos.y(), *paint);
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index de868274e1..77affa0c59 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -839,7 +839,6 @@ static SkScalar refine_cubic_root(const SkFP coeff[4], SkScalar root)
* keeping the existing sorting, and return the new count
*/
static int collaps_duplicates(float array[], int count) {
- int n = count;
for (int n = count; n > 1; --n) {
if (array[0] == array[1]) {
for (int i = 1; i < n; ++i) {
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index c2082c7e37..c51ddcca7f 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -171,11 +171,9 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) {
fReader.setMemory(buffer, size);
}
- int i;
-
fBitmapCount = src.fBitmapCount;
fBitmaps = SkNEW_ARRAY(SkBitmap, fBitmapCount);
- for (i = 0; i < fBitmapCount; i++) {
+ for (int i = 0; i < fBitmapCount; i++) {
fBitmaps[i] = src.fBitmaps[i];
}
@@ -185,7 +183,7 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) {
fPaintCount = src.fPaintCount;
fPaints = SkNEW_ARRAY(SkPaint, fPaintCount);
- for (i = 0; i < fPaintCount; i++) {
+ for (int i = 0; i < fPaintCount; i++) {
fPaints[i] = src.fPaints[i];
}
@@ -201,7 +199,7 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) {
fRegionCount = src.fRegionCount;
fRegions = SkNEW_ARRAY(SkRegion, fRegionCount);
- for (i = 0; i < fRegionCount; i++) {
+ for (int i = 0; i < fRegionCount; i++) {
fRegions[i] = src.fRegions[i];
}
}
@@ -429,11 +427,11 @@ SkPicturePlayback::SkPicturePlayback(SkStream* stream) {
/*
Now read the arrays chunk, and parse using a read buffer
*/
- uint32_t size = readTagSize(stream, PICT_ARRAYS_TAG);
- SkAutoMalloc storage(size);
- stream->read(storage.get(), size);
+ uint32_t tagSize = readTagSize(stream, PICT_ARRAYS_TAG);
+ SkAutoMalloc storage(tagSize);
+ stream->read(storage.get(), tagSize);
- SkFlattenableReadBuffer buffer(storage.get(), size);
+ SkFlattenableReadBuffer buffer(storage.get(), tagSize);
fFactoryPlayback->setupBuffer(buffer);
fTFPlayback.setupBuffer(buffer);
@@ -463,9 +461,10 @@ SkPicturePlayback::SkPicturePlayback(SkStream* stream) {
fRegionCount = readTagSize(buffer, PICT_REGION_TAG);
fRegions = SkNEW_ARRAY(SkRegion, fRegionCount);
for (i = 0; i < fRegionCount; i++) {
- uint32_t size = buffer.readU32();
- SkDEBUGCODE(uint32_t bytes =) fRegions[i].unflatten(buffer.skip(size));
- SkASSERT(size == bytes);
+ uint32_t bufferSize = buffer.readU32();
+ SkDEBUGCODE(uint32_t bytes =)
+ fRegions[i].unflatten(buffer.skip(bufferSize));
+ SkASSERT(bufferSize == bytes);
}
}
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index cf651e1fcb..45464c2efa 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -66,7 +66,7 @@ void SkArithmeticMode_scalar::xfer32(SkPMColor dst[], const SkPMColor src[],
int a, r, g, b;
- if (!srcNeedsUnpremul && !srcNeedsUnpremul) {
+ if (!srcNeedsUnpremul && !dstNeedsUnpremul) {
a = arith(k1, k2, k3, k4, sa, sa);
r = arith(k1, k2, k3, k4, SkGetPackedR32(sc), SkGetPackedR32(dc));
g = arith(k1, k2, k3, k4, SkGetPackedG32(sc), SkGetPackedG32(dc));
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index c6886250fa..e2123e56ff 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -128,10 +128,7 @@ void SkColorMatrixFilter::setup(const SkScalar* SK_RESTRICT src) {
}
int32_t* array = fState.fArray;
-
- int i;
SkFixed max = 0;
-
for (int i = 0; i < 20; i++) {
SkFixed value = SkScalarToFixed(src[i]);
array[i] = value;
@@ -150,7 +147,7 @@ void SkColorMatrixFilter::setup(const SkScalar* SK_RESTRICT src) {
if (bits < 9) {
bits = 9 - bits;
fState.fShift -= bits;
- for (i = 0; i < 20; i++) {
+ for (int i = 0; i < 20; i++) {
array[i] >>= bits;
}
one >>= bits;