2010-08-19 Stephen White <senorblanco@chromium.org>

        Reviewed by Kenneth Russell.

        [CHROMIUM] Assert w/canvas image draw
        https://bugs.webkit.org/show_bug.cgi?id=44279

        Don't use bitmap->pixelRef()->getPixels() directly; prefer
        bitmap->pixels() and an SkAutoLockPixels.  Also, make sure to set
        the backing store state to Software when it was None.  This handles
        missing draws when the first call is software.  Finally, remove some
        spurious prepareForSoftwareDraw() calls in addPath() and beginPath().
        It's really the fillPath() or strokePath() that matters.

        Covered by LayoutTests/fast/canvas/arc360.html and others.

        * platform/graphics/skia/GraphicsContextSkia.cpp:
        (WebCore::GraphicsContext::addPath):
        (WebCore::GraphicsContext::beginPath):
        Remove spurious prepareForSoftwareDraw() calls.
        * platform/graphics/skia/ImageSkia.cpp:
        (WebCore::drawBitmapGLES2):
        Lock SkBitmap's pixels, and use ->getPixels().
        * platform/graphics/skia/PlatformContextSkia.cpp:
        (WebCore::PlatformContextSkia::prepareForSoftwareDraw):
        Switch backing store state to Software when it was None.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 831f35b6
2010-08-19 Stephen White <senorblanco@chromium.org>
Reviewed by Kenneth Russell.
[CHROMIUM] Assert w/canvas image draw
https://bugs.webkit.org/show_bug.cgi?id=44279
Don't use bitmap->pixelRef()->getPixels() directly; prefer
bitmap->pixels() and an SkAutoLockPixels. Also, make sure to set
the backing store state to Software when it was None. This handles
missing draws when the first call is software. Finally, remove some
spurious prepareForSoftwareDraw() calls in addPath() and beginPath().
It's really the fillPath() or strokePath() that matters.
Covered by LayoutTests/fast/canvas/arc360.html and others.
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::addPath):
(WebCore::GraphicsContext::beginPath):
Remove spurious prepareForSoftwareDraw() calls.
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::drawBitmapGLES2):
Lock SkBitmap's pixels, and use ->getPixels().
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::prepareForSoftwareDraw):
Switch backing store state to Software when it was None.
2010-08-19 David Kilzer <ddkilzer@apple.com>
<http://webkit.org/b/44285> Fix compilation with NETSCAPE_PLUGIN_API disabled
......@@ -323,7 +323,6 @@ void GraphicsContext::addPath(const Path& path)
{
if (paintingDisabled())
return;
platformContext()->prepareForSoftwareDraw();
platformContext()->addPath(*path.platformPath());
}
......@@ -331,7 +330,6 @@ void GraphicsContext::beginPath()
{
if (paintingDisabled())
return;
platformContext()->prepareForSoftwareDraw();
platformContext()->beginPath();
}
......
......@@ -419,8 +419,9 @@ static void drawBitmapGLES2(GraphicsContext* ctxt, NativeImageSkia* bitmap, cons
ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config);
ASSERT(bitmap->rowBytes() == bitmap->width() * 4);
texture = gpuCanvas->createTexture(bitmap, GLES2Texture::BGRA8, bitmap->width(), bitmap->height());
ASSERT(bitmap->pixelRef());
texture->load(bitmap->pixelRef()->pixels());
SkAutoLockPixels lock(*bitmap);
ASSERT(bitmap->getPixels());
texture->load(bitmap->getPixels());
}
gpuCanvas->drawTexturedRect(texture, srcRect, dstRect, styleColorSpace, compositeOp);
}
......
......@@ -753,6 +753,8 @@ void PlatformContextSkia::prepareForSoftwareDraw() const
readbackHardwareToSoftware();
m_backingStoreState = Software;
}
} else if (m_backingStoreState == None) {
m_backingStoreState = Software;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment