summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/wx
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/platform/graphics/wx
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/platform/graphics/wx')
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformData.h11
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformDataWx.cpp1
-rw-r--r--WebCore/platform/graphics/wx/FontWx.cpp2
-rw-r--r--WebCore/platform/graphics/wx/GraphicsContextWx.cpp51
-rw-r--r--WebCore/platform/graphics/wx/ImageBufferWx.cpp5
-rw-r--r--WebCore/platform/graphics/wx/ImageWx.cpp1
-rw-r--r--WebCore/platform/graphics/wx/PathWx.cpp23
-rw-r--r--WebCore/platform/graphics/wx/SimpleFontDataWx.cpp8
8 files changed, 87 insertions, 15 deletions
diff --git a/WebCore/platform/graphics/wx/FontPlatformData.h b/WebCore/platform/graphics/wx/FontPlatformData.h
index be00edc..ecb957e 100644
--- a/WebCore/platform/graphics/wx/FontPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontPlatformData.h
@@ -31,9 +31,9 @@
#include "FontDescription.h"
#include "AtomicString.h"
-#include "CString.h"
#include "StringImpl.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
#include <wx/defs.h>
#include <wx/font.h>
@@ -65,21 +65,25 @@ public:
FontPlatformData(WTF::HashTableDeletedValueType)
: m_fontState(DELETED),
- m_font(0)
+ m_font(0),
+ m_size(0)
{ }
~FontPlatformData();
FontPlatformData(const FontDescription&, const AtomicString&);
+
FontPlatformData(float size, bool bold, bool italic)
: m_fontState(UNINITIALIZED)
, m_font(0)
+ , m_size(size)
{
}
FontPlatformData()
: m_fontState(UNINITIALIZED)
, m_font(0)
+ , m_size(0)
{
}
@@ -99,6 +103,8 @@ public:
}
unsigned computeHash() const;
+
+ float size() const { return m_size; }
bool operator==(const FontPlatformData& other) const
{
@@ -127,6 +133,7 @@ public:
private:
WTF::RefPtr<FontHolder> m_font;
FontState m_fontState;
+ float m_size;
};
}
diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
index c9646d7..a75d244 100644
--- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
+++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
@@ -100,6 +100,7 @@ FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicStri
);
#endif
m_fontState = VALID;
+ m_size = desc.computedPixelSize();
}
diff --git a/WebCore/platform/graphics/wx/FontWx.cpp b/WebCore/platform/graphics/wx/FontWx.cpp
index 98b5a0a..dce3841 100644
--- a/WebCore/platform/graphics/wx/FontWx.cpp
+++ b/WebCore/platform/graphics/wx/FontWx.cpp
@@ -121,7 +121,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
}
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const
{
#if OS(WINDOWS)
UniscribeController controller(this, run, fallbackFonts);
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 8e1a391..2298d6a 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -91,6 +91,7 @@ public:
#if USE(WXGC)
wxGCDC* context;
+ wxGraphicsPath currentPath;
#else
wxWindowDC* context;
#endif
@@ -124,6 +125,9 @@ GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
}
#if USE(WXGC)
m_data->context = (wxGCDC*)context;
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc)
+ m_data->currentPath = gc->CreatePath();
#else
m_data->context = (wxWindowDC*)context;
#endif
@@ -323,6 +327,11 @@ void GraphicsContext::clipOutEllipseInRect(const IntRect&)
notImplemented();
}
+void GraphicsContext::clipPath(WindRule)
+{
+ notImplemented();
+}
+
void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing)
{
if (paintingDisabled())
@@ -361,7 +370,15 @@ void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*)
AffineTransform GraphicsContext::getCTM() const
{
- notImplemented();
+#if USE(WXGC)
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc) {
+ wxGraphicsMatrix matrix = gc->GetTransform();
+ double a, b, c, d, e, f;
+ matrix.Get(&a, &b, &c, &d, &e, &f);
+ return AffineTransform(a, b, c, d, e, f);
+ }
+#endif
return AffineTransform();
}
@@ -435,12 +452,19 @@ void GraphicsContext::setCompositeOperation(CompositeOperator op)
void GraphicsContext::beginPath()
{
- notImplemented();
+#if USE(WXGC)
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc)
+ m_data->currentPath = gc->CreatePath();
+#endif
}
void GraphicsContext::addPath(const Path& path)
{
- notImplemented();
+#if USE(WXGC)
+ if (path.platformPath())
+ m_data->currentPath.AddPath(*path.platformPath());
+#endif
}
void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace)
@@ -476,7 +500,11 @@ void GraphicsContext::concatCTM(const AffineTransform& transform)
if (paintingDisabled())
return;
- notImplemented();
+#if USE(WXGC)
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc)
+ gc->ConcatTransform(transform);
+#endif
return;
}
@@ -498,10 +526,20 @@ InterpolationQuality GraphicsContext::imageInterpolationQuality() const
void GraphicsContext::fillPath()
{
+#if USE(WXGC)
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc)
+ gc->FillPath(m_data->currentPath);
+#endif
}
void GraphicsContext::strokePath()
{
+#if USE(WXGC)
+ wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+ if (gc)
+ gc->StrokePath(m_data->currentPath);
+#endif
}
void GraphicsContext::drawPath()
@@ -551,6 +589,11 @@ void GraphicsContext::setLineCap(LineCap)
notImplemented();
}
+void GraphicsContext::setLineDash(const DashArray&, float dashOffset)
+{
+ notImplemented();
+}
+
void GraphicsContext::setLineJoin(LineJoin)
{
notImplemented();
diff --git a/WebCore/platform/graphics/wx/ImageBufferWx.cpp b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
index 49f3f3b..6cc611e 100644
--- a/WebCore/platform/graphics/wx/ImageBufferWx.cpp
+++ b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
@@ -87,4 +87,9 @@ Image* ImageBuffer::image() const
return 0;
}
+void ImageBuffer::platformTransformColorSpace(const Vector<int>&)
+{
+ notImplemented();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/graphics/wx/ImageWx.cpp b/WebCore/platform/graphics/wx/ImageWx.cpp
index c246ec1..b51bde8 100644
--- a/WebCore/platform/graphics/wx/ImageWx.cpp
+++ b/WebCore/platform/graphics/wx/ImageWx.cpp
@@ -33,6 +33,7 @@
#include "GraphicsContext.h"
#include "ImageObserver.h"
#include "NotImplemented.h"
+#include "SharedBuffer.h"
#include <math.h>
#include <stdio.h>
diff --git a/WebCore/platform/graphics/wx/PathWx.cpp b/WebCore/platform/graphics/wx/PathWx.cpp
index 6c115ac..2305be0 100644
--- a/WebCore/platform/graphics/wx/PathWx.cpp
+++ b/WebCore/platform/graphics/wx/PathWx.cpp
@@ -30,6 +30,7 @@
#include "FloatPoint.h"
#include "FloatRect.h"
#include "NotImplemented.h"
+#include "PlatformString.h"
#include "StrokeStyleApplier.h"
#include <stdio.h>
@@ -110,10 +111,22 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
return FloatRect();
}
-Path& Path::operator=(const Path&)
+bool Path::strokeContains(StrokeStyleApplier*, const FloatPoint&) const
+{
+ notImplemented();
+ return false;
+}
+
+String Path::debugString() const
+{
+ notImplemented();
+ return String();
+}
+
+Path& Path::operator=(const Path& path)
{
- notImplemented();
- return*this;
+ *m_path = *path.platformPath();
+ return *this;
}
void Path::clear()
@@ -219,8 +232,8 @@ bool Path::isEmpty() const
{
#if USE(WXGC)
if (m_path) {
- wxDouble width, height;
- m_path->GetBox(NULL, NULL, &width, &height);
+ wxDouble x, y, width, height;
+ m_path->GetBox(&x, &y, &width, &height);
return (width == 0 && height == 0);
}
#endif
diff --git a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
index d9fd2b3..3c8a1da 100644
--- a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
+++ b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
@@ -112,17 +112,19 @@ void SimpleFontData::determinePitch()
m_treatAsFixedPitch = false;
}
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
{
+ GlyphMetrics metrics;
#if __WXMSW__
// under Windows / wxMSW we currently always use GDI fonts.
- return widthForGDIGlyph(glyph);
+ metrics.horizontalAdvance = widthForGDIGlyph(glyph);
#else
// TODO: fix this! Make GetTextExtents a method of wxFont in 2.9
int width = 10;
GetTextExtent(*m_platformData.font(), (wxChar)glyph, &width, NULL);
- return width;
+ metrics.horizontalAdvance = width;
#endif
+ return metrics;
}
#if OS(WINDOWS)