summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-05-11 18:35:50 +0100
committerBen Murdoch <benm@google.com>2010-05-14 10:23:05 +0100
commit21939df44de1705786c545cd1bf519d47250322d (patch)
treeef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebCore/platform/graphics/skia
parent4ff1d8891d520763f17675827154340c7c740f90 (diff)
downloadexternal_webkit-21939df44de1705786c545cd1bf519d47250322d.zip
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebCore/platform/graphics/skia')
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp3
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp14
2 files changed, 3 insertions, 14 deletions
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index cc4ca2e..e76ed7b 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -55,10 +55,9 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
SkBitmap& skiaImageRef = *skiaImage;
SkAutoLockPixels lock(skiaImageRef);
- int width = skiaImage->width();
int height = skiaImage->height();
int rowBytes = skiaImage->rowBytes();
- ASSERT(rowBytes == width * 4);
+ ASSERT(rowBytes == skiaImage->width() * 4);
uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels());
outputVector.resize(rowBytes * height);
int size = rowBytes * height;
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 8986685..e16b373 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -91,9 +91,9 @@ inline float square(float n)
// bugs. Leaving the code in for now, so we can revert easily if necessary.
// #define ENSURE_VALUE_SAFETY_FOR_SKIA
+#ifdef ENSURE_VALUE_SAFETY_FOR_SKIA
static bool isCoordinateSkiaSafe(float coord)
{
-#ifdef ENSURE_VALUE_SAFETY_FOR_SKIA
// First check for valid floats.
#if defined(_MSC_VER)
if (!_finite(coord))
@@ -110,10 +110,8 @@ static bool isCoordinateSkiaSafe(float coord)
return false;
return true;
-#else
- return true;
-#endif
}
+#endif
static bool isPointSkiaSafe(const SkMatrix& transform, const SkPoint& pt)
{
@@ -734,8 +732,6 @@ void GraphicsContext::fillRect(const FloatRect& rect)
ClipRectToCanvas(*platformContext()->canvas(), r, &r);
}
- const GraphicsContextState& state = m_common->state;
-
SkPaint paint;
platformContext()->setupPaintForFilling(&paint);
platformContext()->canvas()->drawRect(r, paint);
@@ -1122,11 +1118,8 @@ void GraphicsContext::strokePath()
if (!isPathSkiaSafe(getCTM(), path))
return;
- const GraphicsContextState& state = m_common->state;
-
SkPaint paint;
platformContext()->setupPaintForStroking(&paint, 0, 0);
-
platformContext()->canvas()->drawPath(path, paint);
}
@@ -1138,12 +1131,9 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
if (!isRectSkiaSafe(getCTM(), rect))
return;
- const GraphicsContextState& state = m_common->state;
-
SkPaint paint;
platformContext()->setupPaintForStroking(&paint, 0, 0);
paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
-
platformContext()->canvas()->drawRect(rect, paint);
}