Commit 12821597 authored by staikos@webkit.org's avatar staikos@webkit.org

2009-07-30 Yong Li <yong.li@torchmobile.com>

        Reviewed by George Staikos.

        WINCE PORT: modified graphics files
        https://bugs.webkit.org/show_bug.cgi?id=27779


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9be08721
2009-07-30 Yong Li <yong.li@torchmobile.com>
Reviewed by George Staikos.
WINCE PORT: modified graphics files
https://bugs.webkit.org/show_bug.cgi?id=27779
* platform/graphics/BitmapImage.h:
(WebCore::BitmapImage::mayFillWithSolidColor):
* platform/graphics/Gradient.h:
* platform/graphics/GraphicsContext.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageSource.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/Path.h:
* platform/graphics/Pattern.h:
* platform/graphics/transforms/Matrix3DTransformOperation.cpp:
(WebCore::Matrix3DTransformOperation::blend):
* platform/graphics/transforms/MatrixTransformOperation.cpp:
(WebCore::MatrixTransformOperation::blend):
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::operator*):
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::createIconForFile):
(WebCore::Icon::createIconForFiles):
(WebCore::Icon::paint):
2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Ariya Hidayat.
......
/*
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2008-2009 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -160,7 +161,7 @@ protected:
virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator);
#endif
virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
#if PLATFORM(WX)
#if PLATFORM(WX) || PLATFORM(WINCE)
virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator, const FloatRect& destRect);
#endif
......@@ -220,7 +221,11 @@ protected:
{
if (!m_checkedForSolidColor && frameCount() > 0) {
checkForSolidColor();
// WINCE PORT: checkForSolidColor() doesn't set m_checkedForSolidColor until
// it gets enough information to make final decision.
#if !PLATFORM(WINCE)
ASSERT(m_checkedForSolidColor);
#endif
}
return m_isSolidColor && m_currentFrame == 0;
}
......
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
* Copyright (C) 2008 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -73,8 +74,17 @@ namespace WebCore {
void getColor(float value, float* r, float* g, float* b, float* a) const;
#if PLATFORM(WINCE) && !PLATFORM(QT)
const FloatPoint& p0() const { return m_p0; }
const FloatPoint& p1() const { return m_p1; }
float r0() const { return m_r0; }
float r1() const { return m_r1; }
bool isRadial() const { return m_radial; }
struct ColorStop;
const Vector<ColorStop>& getStops() const;
#else
PlatformGradient platformGradient();
#endif
struct ColorStop {
float stop;
float red;
......
......@@ -324,6 +324,7 @@ void GraphicsContext::drawImage(Image* image, const IntRect& dest, const IntRect
drawImage(image, FloatRect(dest), srcRect, op, useLowQualityScale);
}
#if !PLATFORM(WINCE) || PLATFORM(QT)
void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPoint& point, int from, int to)
{
if (paintingDisabled())
......@@ -331,6 +332,7 @@ void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPo
font.drawText(this, run, point, from, to);
}
#endif
void GraphicsContext::drawBidiText(const Font& font, const TextRun& run, const FloatPoint& point)
{
......
/*
* Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2008-2009 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -65,6 +66,8 @@ class wxWindowDC;
#endif
#elif PLATFORM(SKIA)
typedef class PlatformContextSkia PlatformGraphicsContext;
#elif PLATFORM(WINCE)
typedef struct HDC__ PlatformGraphicsContext;
#else
typedef void PlatformGraphicsContext;
#endif
......@@ -88,6 +91,12 @@ typedef unsigned char UInt8;
namespace WebCore {
#if PLATFORM(WINCE) && !PLATFORM(QT)
class SharedBitmap;
class SimpleFontData;
class GlyphBuffer;
#endif
const int cMisspellingLineThickness = 3;
const int cMisspellingLinePatternWidth = 4;
const int cMisspellingLinePatternGapWidth = 1;
......@@ -142,7 +151,9 @@ namespace WebCore {
GraphicsContext(PlatformGraphicsContext*);
~GraphicsContext();
#if !PLATFORM(WINCE) || PLATFORM(QT)
PlatformGraphicsContext* platformContext() const;
#endif
float strokeThickness() const;
void setStrokeThickness(float);
......@@ -294,7 +305,22 @@ namespace WebCore {
void concatCTM(const TransformationMatrix&);
TransformationMatrix getCTM() const;
#if PLATFORM(WIN)
#if PLATFORM(WINCE) && !PLATFORM(QT)
void setBitmap(PassRefPtr<SharedBitmap>);
const TransformationMatrix& affineTransform() const;
TransformationMatrix& affineTransform();
void resetAffineTransform();
void fillRect(const FloatRect&, const Gradient*);
void drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point);
void drawFrameControl(const IntRect& rect, unsigned type, unsigned state);
void drawFocusRect(const IntRect& rect);
void paintTextField(const IntRect& rect, unsigned state);
void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, CompositeOperator compositeOp);
void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const TransformationMatrix& patternTransform, const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize);
void drawIcon(HICON icon, const IntRect& dstRect, UINT flags);
HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in HDC should be the one handed back by getWindowsContext.
#elif PLATFORM(WIN)
GraphicsContext(HDC, bool hasAlpha = false); // FIXME: To be removed.
bool inTransparencyLayer() const;
HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
......
/*
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2007-2008 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -46,6 +47,8 @@ struct _cairo_surface;
typedef struct _cairo_surface cairo_surface_t;
#elif PLATFORM(SKIA)
class NativeImageSkia;
#elif PLATFORM(WINCE)
#include "SharedBitmap.h"
#endif
namespace WebCore {
......@@ -78,6 +81,10 @@ typedef cairo_surface_t* NativeImagePtr;
class ImageDecoder;
typedef ImageDecoder* NativeImageSourcePtr;
typedef NativeImageSkia* NativeImagePtr;
#elif PLATFORM(WINCE)
class ImageDecoder;
typedef ImageDecoder* NativeImageSourcePtr;
typedef RefPtr<SharedBitmap> NativeImagePtr;
#endif
const int cAnimationLoopOnce = -1;
......
......@@ -38,6 +38,8 @@
#if PLATFORM(MAC)
#include "MediaPlayerPrivateQTKit.h"
#elif PLATFORM(WINCE)
#include "MediaPlayerPrivateWince.h"
#elif PLATFORM(WIN)
#include "MediaPlayerPrivateQuickTimeWin.h"
#elif PLATFORM(GTK)
......
/*
* Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
* 2006 Rob Buis <buis@kde.org>
* Copyright (C) 2007-2008 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -48,6 +49,10 @@ typedef WebCore::CairoPath PlatformPath;
#elif PLATFORM(SKIA)
class SkPath;
typedef SkPath PlatformPath;
#elif PLATFORM(WINCE)
namespace WebCore {
class PlatformPath;
}
#else
typedef void PlatformPath;
#endif
......
/*
* Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2008 Eric Seidel <eric@webkit.org>
* Copyright (C) 2007-2008 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -52,6 +53,8 @@ typedef wxGraphicsBrush* PlatformPatternPtr;
class wxBrush;
typedef wxBrush* PlatformPatternPtr;
#endif // USE(WXGC)
#elif PLATFORM(WINCE)
typedef void* PlatformPatternPtr;
#endif
namespace WebCore {
......
......@@ -47,7 +47,7 @@ PassRefPtr<TransformOperation> Matrix3DTransformOperation::blend(const Transform
apply(toT, size);
if (blendToIdentity)
swap(fromT, toT);
std::swap(fromT, toT);
toT.blend(fromT, progress);
return Matrix3DTransformOperation::create(toT);
......
......@@ -43,7 +43,7 @@ PassRefPtr<TransformOperation> MatrixTransformOperation::blend(const TransformOp
}
if (blendToIdentity)
swap(fromT, toT);
std::swap(fromT, toT);
toT.blend(fromT, progress);
return MatrixTransformOperation::create(toT.a(), toT.b(), toT.c(), toT.d(), toT.e(), toT.f());
......
......@@ -284,7 +284,7 @@ public:
}
// result = *this * t (i.e., a multRight)
TransformationMatrix operator*(const TransformationMatrix& t)
TransformationMatrix operator*(const TransformationMatrix& t) const
{
TransformationMatrix result = t;
result.multLeft(*this);
......
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007-2009 Torch Mobile, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -26,6 +27,11 @@
#include <tchar.h>
#include <windows.h>
#if PLATFORM(WINCE)
// SHGFI_SHELLICONSIZE is not available on WINCE
#define SHGFI_SHELLICONSIZE 0
#endif
namespace WebCore {
static const int shell32MultipleFileIconIndex = 54;
......@@ -55,6 +61,9 @@ PassRefPtr<Icon> Icon::createIconForFile(const String& filename)
PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
{
#if PLATFORM(WINCE)
return 0;
#else
TCHAR buffer[MAX_PATH];
UINT length = ::GetSystemDirectory(buffer, ARRAYSIZE(buffer));
if (!length)
......@@ -67,6 +76,7 @@ PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
if (!::ExtractIconEx(buffer, shell32MultipleFileIconIndex, 0, &hIcon, 1))
return 0;
return adoptRef(new Icon(hIcon));
#endif
}
void Icon::paint(GraphicsContext* context, const IntRect& r)
......@@ -74,11 +84,15 @@ void Icon::paint(GraphicsContext* context, const IntRect& r)
if (context->paintingDisabled())
return;
#if PLATFORM(WINCE)
context->drawIcon(m_hIcon, r, DI_NORMAL);
#else
HDC hdc = context->getWindowsContext(r);
DrawIconEx(hdc, r.x(), r.y(), m_hIcon, r.width(), r.height(), 0, 0, DI_NORMAL);
context->releaseWindowsContext(hdc, r);
#endif
}
}
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