diff options
author | Chris Craik <ccraik@google.com> | 2012-10-16 14:40:03 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-10-16 14:40:03 -0700 |
commit | 285c0572401578498b0ccb0c3da0828544f2d085 (patch) | |
tree | 11432bbb616ffdc6a99fd1595a495dd7ed65f37c /Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp | |
parent | 8ff03fa0f7c92946342312e651aaf8a35f8f3b3c (diff) | |
download | external_webkit-285c0572401578498b0ccb0c3da0828544f2d085.zip external_webkit-285c0572401578498b0ccb0c3da0828544f2d085.tar.gz external_webkit-285c0572401578498b0ccb0c3da0828544f2d085.tar.bz2 |
Add src rect ptr null check
bug:7339156
Also fix compilation issue for USE_RECORDING_CONTEXT = false, a flag
used in debugging.
Change-Id: I63924c7551c82a10b0c67cbb44b9b8961551decd
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp index a410ba9..10bf363 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp @@ -776,13 +776,15 @@ void PlatformGraphicsContextRecording::drawBitmapPattern( } void PlatformGraphicsContextRecording::drawBitmapRect(const SkBitmap& bitmap, - const SkIRect* src, const SkRect& dst, + const SkIRect* srcPtr, const SkRect& dst, CompositeOperator op) { float widthScale = dst.width() == 0 ? 1 : bitmap.width() / dst.width(); float heightScale = dst.height() == 0 ? 1 : bitmap.height() / dst.height(); m_maxZoomScale = std::max(m_maxZoomScale, std::max(widthScale, heightScale)); - appendDrawingOperation(NEW_OP(DrawBitmapRect)(bitmap, *src, dst, op), dst); + // null src implies full bitmap as source rect + SkIRect src = srcPtr ? *srcPtr : SkIRect::MakeWH(bitmap.width(), bitmap.height()); + appendDrawingOperation(NEW_OP(DrawBitmapRect)(bitmap, src, dst, op), dst); } void PlatformGraphicsContextRecording::drawConvexPolygon(size_t numPoints, |