diff options
author | Shimeng (Simon) Wang <swang@google.com> | 2010-12-07 17:22:45 -0800 |
---|---|---|
committer | Shimeng (Simon) Wang <swang@google.com> | 2010-12-22 14:15:40 -0800 |
commit | 4576aa36e9a9671459299c7963ac95aa94beaea9 (patch) | |
tree | 3863574e050f168c0126ecb47c83319fab0972d8 /WebCore/platform/graphics/skia | |
parent | 55323ac613cc31553107b68603cb627264d22bb0 (diff) | |
download | external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.zip external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.gz external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.bz2 |
Merge WebKit at r73109: Initial merge by git.
Change-Id: I61f1a66d9642e3d8405d3ac6ccab2a53421c75d8
Diffstat (limited to 'WebCore/platform/graphics/skia')
-rw-r--r-- | WebCore/platform/graphics/skia/GraphicsContextSkia.cpp | 20 | ||||
-rw-r--r-- | WebCore/platform/graphics/skia/ImageBufferSkia.cpp | 6 |
2 files changed, 22 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp index e506e5d..6f6dce8 100644 --- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp @@ -420,11 +420,15 @@ void GraphicsContext::clipOut(const Path& p) platformContext()->canvas()->clipPath(path, SkRegion::kDifference_Op); } -void GraphicsContext::clipPath(WindRule clipRule) +void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule) { if (paintingDisabled()) return; + // FIXME: Be smarter about this. + beginPath(); + addPath(pathToClip); + SkPath path = platformContext()->currentPathInLocalCoordinates(); if (!isPathSkiaSafe(getCTM(), path)) return; @@ -513,7 +517,7 @@ void GraphicsContext::drawEllipse(const IntRect& elipseRect) } } -void GraphicsContext::drawFocusRing(const Vector<Path>& paths, int width, int offset, const Color& color) +void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color) { // FIXME: implement } @@ -723,11 +727,15 @@ void GraphicsContext::drawRect(const IntRect& rect) platformContext()->drawRect(r); } -void GraphicsContext::fillPath() +void GraphicsContext::fillPath(const Path& pathToFill) { if (paintingDisabled()) return; + // FIXME: Be smarter about this. + beginPath(); + addPath(pathToFill); + SkPath path = platformContext()->currentPathInLocalCoordinates(); if (!isPathSkiaSafe(getCTM(), path)) return; @@ -1177,11 +1185,15 @@ void GraphicsContext::strokeArc(const IntRect& r, int startAngle, int angleSpan) platformContext()->canvas()->drawPath(path, paint); } -void GraphicsContext::strokePath() +void GraphicsContext::strokePath(const Path& pathToStroke) { if (paintingDisabled()) return; + // FIXME: Be smarter about this. + beginPath(); + addPath(pathToStroke); + SkPath path = platformContext()->currentPathInLocalCoordinates(); if (!isPathSkiaSafe(getCTM(), path)) return; diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp index 0db96cf..adb732b 100644 --- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp +++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp @@ -183,6 +183,9 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap, endX = size.width(); int numColumns = endX - originX; + if (numColumns <= 0) + return result; + int originY = rect.y(); int destY = 0; if (originY < 0) { @@ -194,6 +197,9 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap, endY = size.height(); int numRows = endY - originY; + if (numRows <= 0) + return result; + ASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config); SkAutoLockPixels bitmapLock(bitmap); |