summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /Source/WebCore/platform/graphics/skia
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/platform/graphics/skia')
-rw-r--r--Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp4
-rw-r--r--Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h4
-rw-r--r--Source/WebCore/platform/graphics/skia/GraphicsContextPlatformPrivate.h4
-rw-r--r--Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp15
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp5
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp5
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.h3
7 files changed, 31 insertions, 9 deletions
diff --git a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
index e94c417..0b31dfa 100644
--- a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
+++ b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
@@ -35,8 +35,8 @@
#if OS(WINDOWS)
#include "Base64.h"
-#include "ChromiumBridge.h"
#include "OpenTypeUtilities.h"
+#include "PlatformBridge.h"
#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include "SkStream.h"
#endif
@@ -91,7 +91,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
logFont.lfStrikeOut = false;
logFont.lfCharSet = DEFAULT_CHARSET;
logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
- logFont.lfQuality = ChromiumBridge::layoutTestMode() ?
+ logFont.lfQuality = PlatformBridge::layoutTestMode() ?
NONANTIALIASED_QUALITY :
DEFAULT_QUALITY; // Honor user's desktop settings.
logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
diff --git a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h
index e51b6b6..4228b40 100644
--- a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h
+++ b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h
@@ -49,7 +49,9 @@ namespace WebCore {
class FontPlatformData;
class SharedBuffer;
-struct FontCustomPlatformData : Noncopyable {
+struct FontCustomPlatformData {
+ WTF_MAKE_NONCOPYABLE(FontCustomPlatformData);
+public:
#if OS(WINDOWS)
FontCustomPlatformData(HANDLE fontReference, const String& name)
: m_fontReference(fontReference)
diff --git a/Source/WebCore/platform/graphics/skia/GraphicsContextPlatformPrivate.h b/Source/WebCore/platform/graphics/skia/GraphicsContextPlatformPrivate.h
index 5e12ad6..44835a4 100644
--- a/Source/WebCore/platform/graphics/skia/GraphicsContextPlatformPrivate.h
+++ b/Source/WebCore/platform/graphics/skia/GraphicsContextPlatformPrivate.h
@@ -31,14 +31,14 @@
#ifndef GraphicsContextPlatformPrivate_h
#define GraphicsContextPlatformPrivate_h
-#include <wtf/Noncopyable.h>
class PlatformContextSkia;
namespace WebCore {
// This class just holds onto a PlatformContextSkia for GraphicsContext.
-class GraphicsContextPlatformPrivate : public Noncopyable {
+class GraphicsContextPlatformPrivate {
+ WTF_MAKE_NONCOPYABLE(GraphicsContextPlatformPrivate);
public:
GraphicsContextPlatformPrivate(PlatformContextSkia* platformContext)
: m_context(platformContext) { }
diff --git a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 51e2477..1a7112b 100644
--- a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -386,6 +386,9 @@ void GraphicsContext::canvasClip(const Path& path)
if (paintingDisabled())
return;
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->clipPath(path);
+
const SkPath& p = *path.platformPath();
if (!isPathSkiaSafe(getCTM(), p))
return;
@@ -410,6 +413,9 @@ void GraphicsContext::clipOut(const Path& p)
if (paintingDisabled())
return;
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->clipOut(p);
+
const SkPath& path = *p.platformPath();
if (!isPathSkiaSafe(getCTM(), path))
return;
@@ -422,6 +428,9 @@ void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule)
if (paintingDisabled())
return;
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->clipPath(pathToClip);
+
// FIXME: Be smarter about this.
beginPath();
addPath(pathToClip);
@@ -733,6 +742,12 @@ void GraphicsContext::fillPath(const Path& pathToFill)
beginPath();
addPath(pathToFill);
+ if (platformContext()->useGPU() && platformContext()->canAccelerate()) {
+ platformContext()->prepareForHardwareDraw();
+ platformContext()->gpuCanvas()->fillPath(pathToFill);
+ return;
+ }
+
SkPath path = platformContext()->currentPathInLocalCoordinates();
if (!isPathSkiaSafe(getCTM(), path))
return;
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index b65b5bd..2c489ef 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -91,6 +91,11 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
+size_t ImageBuffer::dataSize() const
+{
+ return m_size.width() * m_size.height() * 4;
+}
+
bool ImageBuffer::drawsUsingCopy() const
{
return false;
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index d3c0e00..d852e9b 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -702,8 +702,7 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
bool PlatformContextSkia::canAccelerate() const
{
return !m_state->m_fillShader // Can't accelerate with a fill gradient or pattern.
- && !m_state->m_looper // Can't accelerate with a shadow.
- && !m_state->m_canvasClipApplied; // Can't accelerate with a clip to path applied.
+ && !m_state->m_looper; // Can't accelerate with a shadow.
}
bool PlatformContextSkia::canvasClipApplied() const
@@ -848,7 +847,7 @@ void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const
m_uploadTexture->updateSubRect(bitmap.getPixels(), m_softwareDirtyRect);
AffineTransform identity;
- gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, ColorSpaceDeviceRGB, op);
+ gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, ColorSpaceDeviceRGB, op, false);
// Clear out the region of the software canvas we just uploaded.
m_canvas->save();
m_canvas->resetMatrix();
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 11b311a..0304486 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -67,7 +67,8 @@ class Texture;
// responsible for managing the painting state which is store in separate
// SkPaint objects. This class provides the adaptor that allows the painting
// state to be pushed and popped along with the bitmap.
-class PlatformContextSkia : public Noncopyable {
+class PlatformContextSkia {
+ WTF_MAKE_NONCOPYABLE(PlatformContextSkia);
public:
// For printing, there shouldn't be any canvas. canvas can be NULL. If you
// supply a NULL canvas, you can also call setCanvas later.