summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/skia')
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp21
-rw-r--r--WebCore/platform/graphics/skia/ImageBufferSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp1
-rw-r--r--WebCore/platform/graphics/skia/NativeImageSkia.cpp8
-rw-r--r--WebCore/platform/graphics/skia/NativeImageSkia.h5
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp125
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h40
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.cpp4
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.h5
9 files changed, 134 insertions, 77 deletions
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 7994244..7bcd84b 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -786,8 +786,6 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (paintingDisabled())
return;
- platformContext()->save();
-
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r)) {
// See the other version of fillRect below.
@@ -802,6 +800,8 @@ void GraphicsContext::fillRect(const FloatRect& rect)
}
#endif
+ platformContext()->save();
+
platformContext()->prepareForSoftwareDraw();
SkPaint paint;
@@ -1276,4 +1276,21 @@ void GraphicsContext::translate(float w, float h)
WebCoreFloatToSkScalar(h));
}
+void GraphicsContext::setGraphicsContext3D(GraphicsContext3D* context3D, const IntSize& size)
+{
+#if USE(GLES2_RENDERING)
+ platformContext()->setGraphicsContext3D(context3D, size);
+#else
+ UNUSED_PARAM(context3D);
+ UNUSED_PARAM(size);
+#endif
+}
+
+void GraphicsContext::syncSoftwareCanvas()
+{
+#if USE(GLES2_RENDERING)
+ platformContext()->syncSoftwareCanvas();
+#endif
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 3eb033d..eaa91ec 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -131,7 +131,7 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap,
if (bitmap.config() == SkBitmap::kNo_Config) {
// This is an empty SkBitmap that could not be configured.
- ASSERT(size.width() == 0 || size.height() == 0);
+ ASSERT(!size.width() || !size.height());
return result;
}
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index a2485e6..024bf50 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -414,7 +414,6 @@ static void drawBitmapGLES2(GraphicsContext* ctxt, NativeImageSkia* bitmap, cons
{
ctxt->platformContext()->prepareForHardwareDraw();
GLES2Canvas* gpuCanvas = ctxt->platformContext()->gpuCanvas();
- gpuCanvas->gles2Context()->makeCurrent();
GLES2Texture* texture = gpuCanvas->getTexture(bitmap);
if (!texture) {
ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config);
diff --git a/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/WebCore/platform/graphics/skia/NativeImageSkia.cpp
index 2411897..007a32c 100644
--- a/WebCore/platform/graphics/skia/NativeImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/NativeImageSkia.cpp
@@ -37,6 +37,8 @@
#include "NativeImageSkia.h"
#include "SkiaUtils.h"
+namespace WebCore {
+
NativeImageSkia::NativeImageSkia()
: m_isDataComplete(false),
m_lastRequestSize(0, 0),
@@ -54,7 +56,7 @@ bool NativeImageSkia::hasResizedBitmap(int w, int h) const
if (m_lastRequestSize.width() == w && m_lastRequestSize.height() == h)
m_resizeRequests++;
else {
- m_lastRequestSize = WebCore::IntSize(w, h);
+ m_lastRequestSize = IntSize(w, h);
m_resizeRequests = 0;
}
@@ -101,7 +103,7 @@ bool NativeImageSkia::shouldCacheResampling(int destWidth,
} else {
// When a different size is being requested, count this as a query
// (hasResizedBitmap) and reset the counter.
- m_lastRequestSize = WebCore::IntSize(destWidth, destHeight);
+ m_lastRequestSize = IntSize(destWidth, destHeight);
m_resizeRequests = 0;
}
@@ -111,3 +113,5 @@ bool NativeImageSkia::shouldCacheResampling(int destWidth,
int destSubsetSize = destSubsetWidth * destSubsetHeight;
return destSize / 4 < destSubsetSize;
}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/skia/NativeImageSkia.h b/WebCore/platform/graphics/skia/NativeImageSkia.h
index 5947238..0718836 100644
--- a/WebCore/platform/graphics/skia/NativeImageSkia.h
+++ b/WebCore/platform/graphics/skia/NativeImageSkia.h
@@ -34,6 +34,8 @@
#include "SkBitmap.h"
#include "IntSize.h"
+namespace WebCore {
+
// This object is used as the "native image" in our port. When WebKit uses
// "NativeImagePtr", it is a pointer to this type. It is an SkBitmap, but also
// stores a cached resized image.
@@ -96,9 +98,10 @@ private:
// This allows us to see if many requests have been made for the same
// resized image, we know that we should probably cache it, even if all of
// those requests individually are small and would not otherwise be cached.
- mutable WebCore::IntSize m_lastRequestSize;
+ mutable IntSize m_lastRequestSize;
mutable int m_resizeRequests;
};
+}
#endif // NativeImageSkia_h
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 65c6e95..abf04f9 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -30,6 +30,10 @@
#include "config.h"
+#include "PlatformContextSkia.h"
+
+#include "AffineTransform.h"
+#include "CanvasLayerChromium.h"
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "NativeImageSkia.h"
@@ -45,20 +49,18 @@
#include "SkDashPathEffect.h"
#if USE(GLES2_RENDERING)
+#include "GraphicsContext3D.h"
#include "GLES2Canvas.h"
-#include "GLES2Context.h"
#include "GLES2Texture.h"
-#include <GLES2/gl2.h>
#endif
#include <wtf/MathExtras.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/Vector.h>
-namespace WebCore
-{
+namespace WebCore {
+
extern bool isPathSkiaSafe(const SkMatrix& transform, const SkPath& path);
-}
// State -----------------------------------------------------------------------
@@ -80,7 +82,7 @@ struct PlatformContextSkia::State {
SkShader* m_fillShader;
// Stroke.
- WebCore::StrokeStyle m_strokeStyle;
+ StrokeStyle m_strokeStyle;
SkColor m_strokeColor;
SkShader* m_strokeShader;
float m_strokeThickness;
@@ -101,13 +103,13 @@ struct PlatformContextSkia::State {
// If non-empty, the current State is clipped to this image.
SkBitmap m_imageBufferClip;
// If m_imageBufferClip is non-empty, this is the region the image is clipped to.
- WebCore::FloatRect m_clip;
+ FloatRect m_clip;
#endif
// This is a list of clipping paths which are currently active, in the
// order in which they were pushed.
WTF::Vector<SkPath> m_antiAliasClipPaths;
- WebCore::InterpolationQuality m_interpolationQuality;
+ InterpolationQuality m_interpolationQuality;
PlatformContextSkia::State cloneInheritedProperties();
private:
@@ -123,8 +125,8 @@ PlatformContextSkia::State::State()
, m_looper(0)
, m_fillColor(0xFF000000)
, m_fillShader(0)
- , m_strokeStyle(WebCore::SolidStroke)
- , m_strokeColor(WebCore::Color::black)
+ , m_strokeStyle(SolidStroke)
+ , m_strokeColor(Color::black)
, m_strokeShader(0)
, m_strokeThickness(0)
, m_dashRatio(3)
@@ -132,8 +134,8 @@ PlatformContextSkia::State::State()
, m_lineCap(SkPaint::kDefault_Cap)
, m_lineJoin(SkPaint::kDefault_Join)
, m_dash(0)
- , m_textDrawingMode(WebCore::cTextFill)
- , m_interpolationQuality(WebCore::InterpolationHigh)
+ , m_textDrawingMode(cTextFill)
+ , m_interpolationQuality(InterpolationHigh)
{
}
@@ -219,6 +221,12 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
PlatformContextSkia::~PlatformContextSkia()
{
+#if USE(GLES2_RENDERING) && USE(ACCELERATED_COMPOSITING)
+ if (m_gpuCanvas) {
+ CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(m_gpuCanvas->context()->platformLayer());
+ layer->setPrepareTextureCallback(0);
+ }
+#endif
}
void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas)
@@ -256,8 +264,8 @@ void PlatformContextSkia::save()
}
#if OS(LINUX) || OS(WINDOWS)
-void PlatformContextSkia::beginLayerClippedToImage(const WebCore::FloatRect& rect,
- const WebCore::ImageBuffer* imageBuffer)
+void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect,
+ const ImageBuffer* imageBuffer)
{
// Skia doesn't support clipping to an image, so we create a layer. The next
// time restore is invoked the layer and |imageBuffer| are combined to
@@ -329,8 +337,8 @@ void PlatformContextSkia::drawRect(SkRect rect)
canvas()->drawRect(rect, paint);
}
- if (m_state->m_strokeStyle != WebCore::NoStroke &&
- (m_state->m_strokeColor & 0xFF000000)) {
+ if (m_state->m_strokeStyle != NoStroke
+ && (m_state->m_strokeColor & 0xFF000000)) {
// We do a fill of four rects to simulate the stroke of a border.
SkColor oldFillColor = m_state->m_fillColor;
@@ -392,13 +400,13 @@ float PlatformContextSkia::setupPaintForStroking(SkPaint* paint, SkRect* rect, i
paint->setPathEffect(m_state->m_dash);
else {
switch (m_state->m_strokeStyle) {
- case WebCore::NoStroke:
- case WebCore::SolidStroke:
+ case NoStroke:
+ case SolidStroke:
break;
- case WebCore::DashedStroke:
+ case DashedStroke:
width = m_state->m_dashRatio * width;
// Fall through.
- case WebCore::DottedStroke:
+ case DottedStroke:
// Truncate the width, since we don't want fuzzy dots or dashes.
int dashLength = static_cast<int>(width);
// Subtract off the endcaps, since they're rendered separately.
@@ -467,12 +475,12 @@ SkDrawLooper* PlatformContextSkia::getDrawLooper() const
return m_state->m_looper;
}
-WebCore::StrokeStyle PlatformContextSkia::getStrokeStyle() const
+StrokeStyle PlatformContextSkia::getStrokeStyle() const
{
return m_state->m_strokeStyle;
}
-void PlatformContextSkia::setStrokeStyle(WebCore::StrokeStyle strokeStyle)
+void PlatformContextSkia::setStrokeStyle(StrokeStyle strokeStyle)
{
m_state->m_strokeStyle = strokeStyle;
}
@@ -514,10 +522,10 @@ float PlatformContextSkia::getAlpha() const
void PlatformContextSkia::setTextDrawingMode(int mode)
{
- // cTextClip is never used, so we assert that it isn't set:
- // https://bugs.webkit.org/show_bug.cgi?id=21898
- ASSERT((mode & WebCore::cTextClip) == 0);
- m_state->m_textDrawingMode = mode;
+ // cTextClip is never used, so we assert that it isn't set:
+ // https://bugs.webkit.org/show_bug.cgi?id=21898
+ ASSERT(!(mode & cTextClip));
+ m_state->m_textDrawingMode = mode;
}
void PlatformContextSkia::setUseAntialiasing(bool enable)
@@ -570,12 +578,12 @@ void PlatformContextSkia::setFillShader(SkShader* fillShader)
}
}
-WebCore::InterpolationQuality PlatformContextSkia::interpolationQuality() const
+InterpolationQuality PlatformContextSkia::interpolationQuality() const
{
return m_state->m_interpolationQuality;
}
-void PlatformContextSkia::setInterpolationQuality(WebCore::InterpolationQuality interpolationQuality)
+void PlatformContextSkia::setInterpolationQuality(InterpolationQuality interpolationQuality)
{
m_state->m_interpolationQuality = interpolationQuality;
}
@@ -604,13 +612,13 @@ bool PlatformContextSkia::isPrinting()
return m_canvas->getTopPlatformDevice().IsVectorial();
}
-void PlatformContextSkia::getImageResamplingHint(WebCore::IntSize* srcSize, WebCore::FloatSize* dstSize) const
+void PlatformContextSkia::getImageResamplingHint(IntSize* srcSize, FloatSize* dstSize) const
{
*srcSize = m_imageResamplingHintSrcSize;
*dstSize = m_imageResamplingHintDstSize;
}
-void PlatformContextSkia::setImageResamplingHint(const WebCore::IntSize& srcSize, const WebCore::FloatSize& dstSize)
+void PlatformContextSkia::setImageResamplingHint(const IntSize& srcSize, const FloatSize& dstSize)
{
m_imageResamplingHintSrcSize = srcSize;
m_imageResamplingHintDstSize = dstSize;
@@ -618,8 +626,8 @@ void PlatformContextSkia::setImageResamplingHint(const WebCore::IntSize& srcSize
void PlatformContextSkia::clearImageResamplingHint()
{
- m_imageResamplingHintSrcSize = WebCore::IntSize();
- m_imageResamplingHintDstSize = WebCore::FloatSize();
+ m_imageResamplingHintSrcSize = IntSize();
+ m_imageResamplingHintDstSize = FloatSize();
}
bool PlatformContextSkia::hasImageResamplingHint() const
@@ -628,7 +636,7 @@ bool PlatformContextSkia::hasImageResamplingHint() const
}
#if OS(LINUX) || OS(WINDOWS)
-void PlatformContextSkia::applyClipFromImage(const WebCore::FloatRect& rect, const SkBitmap& imageBuffer)
+void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitmap& imageBuffer)
{
// NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we
// only look at the alpha when compositing. I'm not 100% sure this is what WebKit expects for image clipping.
@@ -676,10 +684,32 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
}
#if USE(GLES2_RENDERING)
-void PlatformContextSkia::setGLES2Context(WebCore::GLES2Context* context, const WebCore::IntSize& size)
+#if USE(ACCELERATED_COMPOSITING)
+class PrepareTextureCallbackImpl : public CanvasLayerChromium::PrepareTextureCallback {
+public:
+ static PassOwnPtr<PrepareTextureCallbackImpl> create(PlatformContextSkia* pcs)
+ {
+ return new PrepareTextureCallbackImpl(pcs);
+ }
+
+ virtual void willPrepareTexture()
+ {
+ m_pcs->prepareForHardwareDraw();
+ }
+private:
+ explicit PrepareTextureCallbackImpl(PlatformContextSkia* pcs) : m_pcs(pcs) {}
+ PlatformContextSkia* m_pcs;
+};
+#endif
+
+void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context, const WebCore::IntSize& size)
{
m_useGPU = true;
- m_gpuCanvas = new WebCore::GLES2Canvas(context, size);
+ m_gpuCanvas = new GLES2Canvas(context, size);
+#if USE(ACCELERATED_COMPOSITING)
+ CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(context->platformLayer());
+ layer->setPrepareTextureCallback(PrepareTextureCallbackImpl::create(this));
+#endif
}
void PlatformContextSkia::prepareForSoftwareDraw() const
@@ -716,7 +746,7 @@ void PlatformContextSkia::prepareForSoftwareDraw() const
} else if (m_backingStoreState == Mixed) {
if (m_state->m_xferMode != SkXfermode::kSrcOver_Mode) {
// Have to composite our currently software drawn data...
- uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ uploadSoftwareToHardware(CompositeSourceOver);
// then do a readback so we can hardware draw stuff.
readbackHardwareToSoftware();
m_backingStoreState = Software;
@@ -731,11 +761,11 @@ void PlatformContextSkia::prepareForHardwareDraw() const
if (m_backingStoreState == Software) {
// Last drawn in software; upload everything we've drawn.
- uploadSoftwareToHardware(WebCore::CompositeCopy);
+ uploadSoftwareToHardware(CompositeCopy);
} else if (m_backingStoreState == Mixed) {
// Stuff in software/hardware, composite the software stuff on top of
// the hardware stuff.
- uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ uploadSoftwareToHardware(CompositeSourceOver);
}
m_backingStoreState = Hardware;
}
@@ -749,7 +779,7 @@ void PlatformContextSkia::syncSoftwareCanvas() const
readbackHardwareToSoftware();
else if (m_backingStoreState == Mixed) {
// Have to composite our currently software drawn data..
- uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ uploadSoftwareToHardware(CompositeSourceOver);
// then do a readback.
readbackHardwareToSoftware();
m_backingStoreState = Software;
@@ -757,29 +787,30 @@ void PlatformContextSkia::syncSoftwareCanvas() const
m_backingStoreState = Software;
}
-void PlatformContextSkia::uploadSoftwareToHardware(WebCore::CompositeOperator op) const
+void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const
{
const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
SkAutoLockPixels lock(bitmap);
- m_gpuCanvas->gles2Context()->makeCurrent();
// FIXME: Keep a texture around for this rather than constantly creating/destroying one.
- RefPtr<WebCore::GLES2Texture> texture = WebCore::GLES2Texture::create(WebCore::GLES2Texture::BGRA8, bitmap.width(), bitmap.height());
+ GraphicsContext3D* context = m_gpuCanvas->context();
+ RefPtr<GLES2Texture> texture = GLES2Texture::create(context, GLES2Texture::BGRA8, bitmap.width(), bitmap.height());
texture->load(bitmap.getPixels());
- WebCore::IntRect rect(0, 0, bitmap.width(), bitmap.height());
- gpuCanvas()->drawTexturedRect(texture.get(), rect, rect, WebCore::DeviceColorSpace, op);
+ IntRect rect(0, 0, bitmap.width(), bitmap.height());
+ AffineTransform identity;
+ gpuCanvas()->drawTexturedRect(texture.get(), rect, rect, identity, 1.0, DeviceColorSpace, op);
}
void PlatformContextSkia::readbackHardwareToSoftware() const
{
const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(true);
SkAutoLockPixels lock(bitmap);
- m_gpuCanvas->gles2Context()->makeCurrent();
int width = bitmap.width(), height = bitmap.height();
OwnArrayPtr<uint32_t> buf(new uint32_t[width]);
+ GraphicsContext3D* context = m_gpuCanvas->context();
// Flips the image vertically.
for (int y = 0; y < height; ++y) {
uint32_t* pixels = bitmap.getAddr32(0, y);
- glReadPixels(0, height - 1 - y, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ context->readPixels(0, height - 1 - y, width, 1, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels);
for (int i = 0; i < width; ++i) {
uint32_t pixel = pixels[i];
// Swizzles from RGBA -> BGRA.
@@ -787,4 +818,6 @@ void PlatformContextSkia::readbackHardwareToSoftware() const
}
}
}
+
#endif
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 2099dd0..ff80d1b 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -41,16 +41,16 @@
#include "SkPaint.h"
#include "SkPath.h"
-#if USE(GLES2_RENDERING)
+#include <wtf/Vector.h>
+
namespace WebCore {
+
+#if USE(GLES2_RENDERING)
enum CompositeOperator;
class GLES2Canvas;
-class GLES2Context;
-}
+class GraphicsContext3D;
#endif
-#include <wtf/Vector.h>
-
// This class holds the platform-specific state for GraphicsContext. We put
// most of our Skia wrappers on this class. In theory, a lot of this stuff could
// be moved to GraphicsContext directly, except that some code external to this
@@ -97,8 +97,7 @@ public:
// invoked.
// NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
#if OS(LINUX) || OS(WINDOWS)
- void beginLayerClippedToImage(const WebCore::FloatRect&,
- const WebCore::ImageBuffer*);
+ void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*);
#endif
void clipPathAntiAliased(const SkPath&);
@@ -127,7 +126,7 @@ public:
void setXfermodeMode(SkXfermode::Mode);
void setFillColor(SkColor);
void setFillShader(SkShader*);
- void setStrokeStyle(WebCore::StrokeStyle);
+ void setStrokeStyle(StrokeStyle);
void setStrokeColor(SkColor);
void setStrokeThickness(float thickness);
void setStrokeShader(SkShader*);
@@ -136,7 +135,7 @@ public:
void setDashPathEffect(SkDashPathEffect*);
SkDrawLooper* getDrawLooper() const;
- WebCore::StrokeStyle getStrokeStyle() const;
+ StrokeStyle getStrokeStyle() const;
float getStrokeThickness() const;
int getTextDrawingMode() const;
float getAlpha() const;
@@ -155,8 +154,8 @@ public:
skia::PlatformCanvas* canvas() { return m_canvas; }
- WebCore::InterpolationQuality interpolationQuality() const;
- void setInterpolationQuality(WebCore::InterpolationQuality interpolationQuality);
+ InterpolationQuality interpolationQuality() const;
+ void setInterpolationQuality(InterpolationQuality interpolationQuality);
// FIXME: This should be pushed down to GraphicsContext.
void drawRect(SkRect rect);
@@ -178,14 +177,14 @@ public:
// possible quality.
bool isPrinting();
- void getImageResamplingHint(WebCore::IntSize* srcSize, WebCore::FloatSize* dstSize) const;
- void setImageResamplingHint(const WebCore::IntSize& srcSize, const WebCore::FloatSize& dstSize);
+ void getImageResamplingHint(IntSize* srcSize, FloatSize* dstSize) const;
+ void setImageResamplingHint(const IntSize& srcSize, const FloatSize& dstSize);
void clearImageResamplingHint();
bool hasImageResamplingHint() const;
#if USE(GLES2_RENDERING)
bool useGPU() { return m_useGPU; }
- void setGLES2Context(WebCore::GLES2Context*, const WebCore::IntSize&);
- WebCore::GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); }
+ void setGraphicsContext3D(GraphicsContext3D*, const IntSize&);
+ GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); }
#endif
#if USE(GLES2_RENDERING)
@@ -205,12 +204,12 @@ private:
#if OS(LINUX) || OS(WINDOWS)
// Used when restoring and the state has an image clip. Only shows the pixels in
// m_canvas that are also in imageBuffer.
- void applyClipFromImage(const WebCore::FloatRect&, const SkBitmap&);
+ void applyClipFromImage(const FloatRect&, const SkBitmap&);
#endif
void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);
#if USE(GLES2_RENDERING)
- void uploadSoftwareToHardware(WebCore::CompositeOperator) const;
+ void uploadSoftwareToHardware(CompositeOperator) const;
void readbackHardwareToSoftware() const;
#endif
@@ -232,16 +231,17 @@ private:
// Stores image sizes for a hint to compute image resampling modes.
// Values are used in ImageSkia.cpp
- WebCore::IntSize m_imageResamplingHintSrcSize;
- WebCore::FloatSize m_imageResamplingHintDstSize;
+ IntSize m_imageResamplingHintSrcSize;
+ FloatSize m_imageResamplingHintDstSize;
#if OS(WINDOWS)
bool m_drawingToImageBuffer;
#endif
#if USE(GLES2_RENDERING)
bool m_useGPU;
- OwnPtr<WebCore::GLES2Canvas> m_gpuCanvas;
+ OwnPtr<GLES2Canvas> m_gpuCanvas;
mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;
#endif
};
+}
#endif // PlatformContextSkia_h
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index 6595f6b..44003bb 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -220,7 +220,7 @@ void SkiaWinOutlineCache::removePathsForFont(HFONT hfont)
deleteOutline(outlineCache.find(*i));
}
-bool windowsCanHandleDrawTextShadow(WebCore::GraphicsContext *context)
+bool windowsCanHandleDrawTextShadow(GraphicsContext *context)
{
FloatSize shadowSize;
float shadowBlur;
@@ -323,7 +323,7 @@ bool paintSkiaText(GraphicsContext* context,
}
// Stroking on top (if necessary).
- if ((textMode & WebCore::cTextStroke)
+ if ((textMode & cTextStroke)
&& platformContext->getStrokeStyle() != NoStroke
&& platformContext->getStrokeThickness() > 0) {
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.h b/WebCore/platform/graphics/skia/SkiaFontWin.h
index 4c2bb32..40bee62 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.h
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.h
@@ -34,13 +34,14 @@
#include <windows.h>
#include <usp10.h>
-class GraphicsContext;
class SkPath;
class SkPoint;
-class PlatformContextSkia;
namespace WebCore {
+class GraphicsContext;
+class PlatformContextSkia;
+
// FIXME: Rename file to SkiaWinOutlineCache
class SkiaWinOutlineCache {
public: