summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 08:15:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-05-25 08:15:24 -0700
commitfa91a01aee5d4a80ca6c80f722116b850f09996c (patch)
treef72740e60d3c3d4f0ab144e88c03d1f134944ce3 /Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
parent96f37d6d1b390f6690858789706ee6ec25bc1677 (diff)
parentfeebf8e7a79ad68b04a1a948e2b8078d6e5f0048 (diff)
downloadexternal_webkit-fa91a01aee5d4a80ca6c80f722116b850f09996c.zip
external_webkit-fa91a01aee5d4a80ca6c80f722116b850f09996c.tar.gz
external_webkit-fa91a01aee5d4a80ca6c80f722116b850f09996c.tar.bz2
Merge changes I78ff6a85,Ic85c6405,Ibf903baa,I3a0459db,I35140385,I54790419,I6bfe5d24,Ia9f39b83,I5bcecd5a,I1de96683,I543c6810,I8a5b0878,I0ae670bf,Ide4d58dc,I28ebaf3d,I499d6631,Ie5090e0d,I6d3e5f1f
* changes: Merge WebKit at r78450: Update ThirdPartyProject.prop Merge WebKit at r78450: Add new Font::canExpandAroundIdeographsInComplexText() Merge WebKit at r78450: Add new ChromeClient::selectItemAlignmentFollowsMenuWritingDirection() Merge WebKit at r78450: FrameLoaderClient::didRunInsecureContent() signature changed Merge WebKit at r78450: HTMLAreaElement::getRect() renamed Merge WebKit at r78450: FrameLoader::url() removed Merge WebKit at r78450: HTMLParserQuirks removed Merge WebKit at r78450: TextRun::padding() renamed Merge WebKit at r78450: Use new FontMetrics Merge WebKit at r78450: GraphicsContext current path removed Merge WebKit at r78450: TransformationMatrix multiply methods renamed and meaning changed Merge WebKit at r78450: FontCustomPlatformData::fontPlatformData() signature changed Merge WebKit at r78450: IntRect::bottom()/right() renamed Merge WebKit at r78450: Fix remaining conflicts Merge WebKit at r78450: Fix conflicts due to new ENABLE_WEB_ARCHIVE guard Merge WebKit at r78450: Fix conflicts in media controls Merge WebKit at r78450: Fix Makefiles Merge WebKit at r78450: Initial merge by git.
Diffstat (limited to 'Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp')
-rw-r--r--Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index 9b672d2..7b1c27b 100644
--- a/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -23,7 +23,6 @@
#include "GraphicsContext.h"
#include "AffineTransform.h"
-#include "CharacterNames.h"
#include "Font.h"
#include "GDIExtras.h"
#include "GlyphBuffer.h"
@@ -33,9 +32,9 @@
#include "PlatformPathWinCE.h"
#include "SharedBitmap.h"
#include "SimpleFontData.h"
-#include <wtf/OwnPtr.h>
-
#include <windows.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/unicode/CharacterNames.h>
namespace WebCore {
@@ -62,7 +61,7 @@ static inline int stableRound(double d)
// Unlike enclosingIntRect(), this function does strict rounding.
static inline IntRect roundRect(const FloatRect& r)
{
- return IntRect(stableRound(r.x()), stableRound(r.y()), stableRound(r.right()) - stableRound(r.x()), stableRound(r.bottom()) - stableRound(r.y()));
+ return IntRect(stableRound(r.x()), stableRound(r.y()), stableRound(r.maxX()) - stableRound(r.x()), stableRound(r.maxY()) - stableRound(r.y()));
}
// Rotation transformation
@@ -129,8 +128,8 @@ template<class Transform, class Rect, class Value> static inline Rect mapRect(co
{
Value x[4], y[4];
Value l, t, r, b;
- r = rect.right() - 1;
- b = rect.bottom() - 1;
+ r = rect.maxX() - 1;
+ b = rect.maxY() - 1;
transform.map(rect.x(), rect.y(), x, y);
transform.map(rect.x(), b, x + 1, y + 1);
transform.map(r, b, x + 2, y + 2);
@@ -503,10 +502,10 @@ TransparentLayerDC::TransparentLayerDC(GraphicsContextPlatformPrivate* data, Int
m_rotation.m_postShiftX -= m_origRect.x();
m_rotation.m_postShiftY -= m_origRect.y();
- FloatPoint topLeft = m_data->m_transform.mapPoint(FloatPoint(rectBeforeTransform->topLeft()));
- FloatPoint topRight(rectBeforeTransform->right() - 1, rectBeforeTransform->y());
+ FloatPoint topLeft = m_data->m_transform.mapPoint(FloatPoint(rectBeforeTransform->location()));
+ FloatPoint topRight(rectBeforeTransform->maxX() - 1, rectBeforeTransform->y());
topRight = m_data->m_transform.mapPoint(topRight);
- FloatPoint bottomLeft(rectBeforeTransform->x(), rectBeforeTransform->bottom() - 1);
+ FloatPoint bottomLeft(rectBeforeTransform->x(), rectBeforeTransform->maxY() - 1);
bottomLeft = m_data->m_transform.mapPoint(bottomLeft);
FloatSize sideTop = topRight - topLeft;
FloatSize sideLeft = bottomLeft - topLeft;
@@ -656,7 +655,7 @@ void GraphicsContext::drawRect(const IntRect& rect)
if (trRect.height() <= 0)
trRect.setHeight(1);
- Rectangle(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
+ Rectangle(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
}
SelectObject(dc, oldPen);
@@ -726,7 +725,7 @@ void GraphicsContext::drawEllipse(const IntRect& rect)
oldPen = SelectObject(dc, GetStockObject(NULL_PEN));
if (brush || pen)
- Ellipse(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
+ Ellipse(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
SelectObject(dc, oldPen);
SelectObject(dc, oldBrush);
@@ -839,7 +838,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
}
HGDIOBJ oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
- Ellipse(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
+ Ellipse(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
SelectObject(dc, oldBrush);
if (newClip)
@@ -960,9 +959,9 @@ void GraphicsContext::clip(const FloatRect& rect)
OwnPtr<HRGN> clipRgn(CreateRectRgn(0, 0, 0, 0));
if (GetClipRgn(m_data->m_dc, clipRgn.get()) > 0)
- IntersectClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
+ IntersectClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
else {
- clipRgn.set(CreateRectRgn(trRect.x(), trRect.y(), trRect.right(), trRect.bottom()));
+ clipRgn.set(CreateRectRgn(trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY()));
SelectClipRgn(m_data->m_dc, clipRgn.get());
}
}
@@ -977,7 +976,7 @@ void GraphicsContext::clipOut(const IntRect& rect)
IntRect trRect = m_data->mapRect(rect);
- ExcludeClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
+ ExcludeClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
}
void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color)
@@ -1093,8 +1092,8 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float width)
OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
HGDIOBJ oldPen = SelectObject(dc, pen.get());
- int right = trRect.right() - 1;
- int bottom = trRect.bottom() - 1;
+ int right = trRect.maxX() - 1;
+ int bottom = trRect.maxY() - 1;
const POINT intPoints[5] =
{
{ trRect.x(), trRect.y() },
@@ -1536,8 +1535,8 @@ void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPo
float oldOpacity = m_data->m_opacity;
m_data->m_opacity *= fillColor().alpha() / 255.0;
- FloatRect textRect = font.selectionRectForText(run, point, font.height(), from, to);
- textRect.setY(textRect.y() - font.ascent());
+ FloatRect textRect = font.selectionRectForText(run, point, font.fontMetrics().height(), from, to);
+ textRect.setY(textRect.y() - font.fontMetrics().ascent());
IntRect trRect = enclosingIntRect(m_data->mapRect(textRect));
RECT bmpRect;
AlphaPaintType alphaPaintType = mustSupportAlpha ? AlphaPaintOther : AlphaPaintNone;
@@ -1546,7 +1545,7 @@ void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPo
GraphicsContext gc(0);
gc.setBitmap(bmp);
gc.scale(FloatSize(m_data->m_transform.a(), m_data->m_transform.d()));
- font.drawText(&gc, run, IntPoint(0, font.ascent()), from, to);
+ font.drawText(&gc, run, IntPoint(0, font.fontMetrics().ascent()), from, to);
}
unsigned key1;
HDC memDC = bmp->getDC(&key1);
@@ -1591,7 +1590,7 @@ void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer
? fontData->platformData().getScaledFontHandle(height, scaleX == scaleY ? 0 : width)
: 0;
- FloatPoint startPoint(point.x(), point.y() - fontData->ascent());
+ FloatPoint startPoint(point.x(), point.y() - fontData->fontMetrics().ascent());
FloatPoint trPoint = m_data->mapPoint(startPoint);
int y = stableRound(trPoint.y());