summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-10-16 14:40:03 -0700
committerChris Craik <ccraik@google.com>2012-10-16 14:40:03 -0700
commit285c0572401578498b0ccb0c3da0828544f2d085 (patch)
tree11432bbb616ffdc6a99fd1595a495dd7ed65f37c
parent8ff03fa0f7c92946342312e651aaf8a35f8f3b3c (diff)
downloadexternal_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
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h2
-rw-r--r--Source/WebKit/android/jni/PicturePile.cpp2
3 files changed, 6 insertions, 4 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,
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
index a8e69f5..eefd270 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
@@ -112,7 +112,7 @@ public:
virtual void clearRect(const FloatRect& rect);
virtual void drawBitmapPattern(const SkBitmap& bitmap, const SkMatrix& matrix,
CompositeOperator compositeOp, const FloatRect& destRect);
- virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src,
+ virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* srcPtr,
const SkRect& dst, CompositeOperator op = CompositeSourceOver);
virtual void drawConvexPolygon(size_t numPoints, const FloatPoint* points,
bool shouldAntialias);
diff --git a/Source/WebKit/android/jni/PicturePile.cpp b/Source/WebKit/android/jni/PicturePile.cpp
index 174980a..44cfccb 100644
--- a/Source/WebKit/android/jni/PicturePile.cpp
+++ b/Source/WebKit/android/jni/PicturePile.cpp
@@ -365,7 +365,7 @@ Picture* PicturePile::recordPicture(PicturePainter* painter, PictureContainer& p
painter->paintContents(&gc, drawArea);
// TODO: consider paint-time checking for these with SkPicture painting?
- pc.maxZoomScale = FLOAT_MAX;
+ pc.maxZoomScale = 1e6;
SkSafeUnref(canvas);
picture->endRecording();