diff options
author | 2012-07-12 15:27:54 +0000 | |
---|---|---|
committer | 2012-07-12 15:27:54 +0000 | |
commit | 83ca337348c74dede813b2022943c25a337f32eb (patch) | |
tree | d726545e4cb90e967106753f5d348e33d900d71d /src/core/SkPictureRecord.cpp | |
parent | 02662b7febb826752a1c55cda243ad48b2b85adb (diff) |
check a hashtable before using a bsearch
Review URL: https://codereview.appspot.com/6345097
git-svn-id: http://skia.googlecode.com/svn/trunk@4572 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r-- | src/core/SkPictureRecord.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index a55c9afe9a..f961bc4c62 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -521,7 +521,7 @@ void SkPictureRecord::addMatrix(const SkMatrix& matrix) { } void SkPictureRecord::addMatrixPtr(const SkMatrix* matrix) { - addInt(fMatrices.find(matrix)); + this->addInt(matrix ? fMatrices.find(*matrix) : 0); } void SkPictureRecord::addPaint(const SkPaint& paint) { @@ -529,7 +529,7 @@ void SkPictureRecord::addPaint(const SkPaint& paint) { } void SkPictureRecord::addPaintPtr(const SkPaint* paint) { - addInt(fPaints.find(paint, &fRCSet, &fTFSet)); + this->addInt(paint ? fPaints.find(*paint, &fRCSet, &fTFSet) : 0); } void SkPictureRecord::addPath(const SkPath& path) { @@ -597,7 +597,7 @@ void SkPictureRecord::addIRectPtr(const SkIRect* rect) { } void SkPictureRecord::addRegion(const SkRegion& region) { - addInt(fRegions.find(®ion)); + addInt(fRegions.find(region)); } void SkPictureRecord::addText(const void* text, size_t byteLength) { @@ -640,7 +640,7 @@ int SkPictureRecord::find(const SkBitmap& bitmap) { uint32_t writeFlags = flattenPixels ? SkFlattenableWriteBuffer::kForceFlattenBitmapPixels_Flag : 0; - int index = fBitmaps.find(&bitmap, &fRCSet, NULL, writeFlags); + int index = fBitmaps.find(bitmap, &fRCSet, NULL, writeFlags); if (flattenPixels) { entry.fIndex = index; |