summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/win
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/platform/win
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/platform/win')
-rw-r--r--WebCore/platform/win/COMPtr.h2
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp11
-rw-r--r--WebCore/platform/win/ContextMenuItemWin.cpp5
-rw-r--r--WebCore/platform/win/DragImageCGWin.cpp5
-rw-r--r--WebCore/platform/win/DragImageCairoWin.cpp155
-rw-r--r--WebCore/platform/win/LoggingWin.cpp100
-rw-r--r--WebCore/platform/win/MIMETypeRegistryWin.cpp20
-rw-r--r--WebCore/platform/win/PopupMenuWin.cpp8
-rw-r--r--WebCore/platform/win/SharedTimerWin.cpp36
-rw-r--r--WebCore/platform/win/SystemTimeWin.cpp13
-rw-r--r--WebCore/platform/win/TemporaryLinkStubs.cpp4
-rw-r--r--WebCore/platform/win/WebCoreTextRenderer.cpp6
12 files changed, 294 insertions, 71 deletions
diff --git a/WebCore/platform/win/COMPtr.h b/WebCore/platform/win/COMPtr.h
index 784495a..692706f 100644
--- a/WebCore/platform/win/COMPtr.h
+++ b/WebCore/platform/win/COMPtr.h
@@ -26,7 +26,9 @@
#ifndef COMPtr_h
#define COMPtr_h
+#ifndef NOMINMAX
#define NOMINMAX
+#endif
#include <guiddef.h>
#include <unknwn.h>
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 129d881..7a88c3a 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -333,10 +333,15 @@ static HGLOBAL createGlobalImageFileDescriptor(const String& url, const String&
fgd->fgd[0].dwFlags = FD_FILESIZE;
fgd->fgd[0].nFileSizeLow = image->image()->data()->size();
- String extension(".");
- extension += WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType(image->response().mimeType());
const String& preferredTitle = title.isEmpty() ? image->response().suggestedFilename() : title;
- fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension.length() ? (TCHAR*)extension.charactersWithNullTermination() : 0, false);
+ String extension = image->image()->filenameExtension();
+ if (extension.isEmpty()) {
+ // Do not continue processing in the rare and unusual case where a decoded image is not able
+ // to provide a filename extension. Something tricky (like a bait-n-switch) is going on
+ return 0;
+ }
+ extension.insert(".", 0);
+ fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, (TCHAR*)extension.charactersWithNullTermination(), false);
if (fsPath.length() <= 0) {
GlobalUnlock(memObj);
diff --git a/WebCore/platform/win/ContextMenuItemWin.cpp b/WebCore/platform/win/ContextMenuItemWin.cpp
index bd10c91..648d593 100644
--- a/WebCore/platform/win/ContextMenuItemWin.cpp
+++ b/WebCore/platform/win/ContextMenuItemWin.cpp
@@ -102,8 +102,7 @@ LPMENUITEMINFO ContextMenuItem::releasePlatformDescription()
ContextMenuItemType ContextMenuItem::type() const
{
ContextMenuItemType type = ActionType;
-
- if ((m_platformDescription->fType & MFT_STRING) && m_platformDescription->hSubMenu)
+ if (((m_platformDescription->fType & ~MFT_OWNERDRAW) == MFT_STRING) && m_platformDescription->hSubMenu)
type = SubmenuType;
else if (m_platformDescription->fType & MFT_SEPARATOR)
type = SeparatorType;
@@ -187,7 +186,7 @@ void ContextMenuItem::setEnabled(bool enabled)
bool ContextMenuItem::enabled() const
{
- return m_platformDescription->fState & MFS_ENABLED;
+ return !(m_platformDescription->fState & MFS_DISABLED);
}
}
diff --git a/WebCore/platform/win/DragImageCGWin.cpp b/WebCore/platform/win/DragImageCGWin.cpp
index 7788572..77b358b 100644
--- a/WebCore/platform/win/DragImageCGWin.cpp
+++ b/WebCore/platform/win/DragImageCGWin.cpp
@@ -37,6 +37,11 @@
namespace WebCore {
+void deallocContext(CGContextRef target)
+{
+ CGContextRelease(target);
+}
+
HBITMAP allocImage(HDC dc, IntSize size, CGContextRef *targetRef)
{
HBITMAP hbmp;
diff --git a/WebCore/platform/win/DragImageCairoWin.cpp b/WebCore/platform/win/DragImageCairoWin.cpp
index 5fff64f..1b8fb06 100644
--- a/WebCore/platform/win/DragImageCairoWin.cpp
+++ b/WebCore/platform/win/DragImageCairoWin.cpp
@@ -29,25 +29,170 @@
#include "CachedImage.h"
#include "GraphicsContext.h"
#include "Image.h"
-#include "NotImplemented.h"
#include "RetainPtr.h"
+#include <cairo-win32.h>
+#include "GraphicsContextPlatformPrivateCairo.h"
+
#include <windows.h>
+extern "C" {
+typedef struct _cairo* CairoContextRef;
+}
+
namespace WebCore {
+void deallocContext(CairoContextRef target)
+{
+ cairo_destroy(target);
+}
+
+HBITMAP allocImage(HDC dc, IntSize size, CairoContextRef* targetRef)
+{
+ BITMAPINFO bmpInfo = {0};
+ bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmpInfo.bmiHeader.biWidth = size.width();
+ bmpInfo.bmiHeader.biHeight = size.height(); // Must be positive!
+ bmpInfo.bmiHeader.biPlanes = 1;
+ bmpInfo.bmiHeader.biBitCount = 32;
+ bmpInfo.bmiHeader.biCompression = BI_RGB;
+ bmpInfo.bmiHeader.biClrUsed = 0; // unused
+ bmpInfo.bmiHeader.biClrImportant = 0;
+
+ LPVOID bits;
+ HBITMAP hbmp = CreateDIBSection(dc, &bmpInfo, DIB_RGB_COLORS, &bits, 0, 0);
+
+ // At this point, we have a Cairo surface that points to a Windows DIB. The DIB interprets
+ // with the opposite meaning of positive Y axis, so everything we draw into this cairo
+ // context is going to be upside down.
+ if (!targetRef)
+ return hbmp;
+
+ cairo_surface_t* bitmapContext = cairo_image_surface_create_for_data((unsigned char*)bits,
+ CAIRO_FORMAT_ARGB32,
+ bmpInfo.bmiHeader.biWidth,
+ bmpInfo.bmiHeader.biHeight,
+ bmpInfo.bmiHeader.biWidth * 4);
+
+ if (!bitmapContext) {
+ DeleteObject(hbmp);
+ return 0;
+ }
+
+ *targetRef = cairo_create (bitmapContext);
+ cairo_surface_destroy (bitmapContext);
+
+ // At this point, we have a Cairo surface that points to a Windows DIB. The DIB interprets
+ // with the opposite meaning of positive Y axis, so everything we draw into this cairo
+ // context is going to be upside down.
+ //
+ // So, we must invert the CTM for the context so that drawing commands will be flipped
+ // before they get written to the internal buffer.
+ cairo_matrix_t matrix;
+ cairo_matrix_init(&matrix, 1.0, 0.0, 0.0, -1.0, 0.0, size.height());
+ cairo_set_matrix(*targetRef, &matrix);
+
+ return hbmp;
+}
+
+static cairo_surface_t* createCairoContextFromBitmap(HBITMAP bitmap)
+{
+ BITMAP info;
+ GetObject(bitmap, sizeof(info), &info);
+ ASSERT(info.bmBitsPixel == 32);
+
+ // At this point, we have a Cairo surface that points to a Windows BITMAP. The BITMAP
+ // has the opposite meaning of positive Y axis, so everything we draw into this cairo
+ // context is going to be upside down.
+ return cairo_image_surface_create_for_data((unsigned char*)info.bmBits,
+ CAIRO_FORMAT_ARGB32,
+ info.bmWidth,
+ info.bmHeight,
+ info.bmWidthBytes);
+}
+
DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
{
- notImplemented();
+ // FIXME: due to the way drag images are done on windows we need
+ // to preprocess the alpha channel <rdar://problem/5015946>
+ if (!image)
+ return 0;
+
+ IntSize srcSize = dragImageSize(image);
+ IntSize dstSize(static_cast<int>(srcSize.width() * scale.width()), static_cast<int>(srcSize.height() * scale.height()));
+
+ HBITMAP hbmp = 0;
+ HDC dc = GetDC(0);
+ HDC dstDC = CreateCompatibleDC(dc);
+
+ if (!dstDC)
+ goto exit;
+
+ CairoContextRef targetContext;
+ hbmp = allocImage(dstDC, dstSize, &targetContext);
+ if (!hbmp)
+ goto exit;
+
+ cairo_surface_t* srcImage = createCairoContextFromBitmap(image);
+
+ // Scale the target surface to the new image size, and flip it
+ // so that when we set the srcImage as the surface it will draw
+ // right-side-up.
+ cairo_translate(targetContext, 0, dstSize.height());
+ cairo_scale(targetContext, scale.width(), -scale.height());
+ cairo_set_source_surface (targetContext, srcImage, 0.0, 0.0);
- return image;
+ // Now we can paint and get the correct result
+ cairo_paint(targetContext);
+
+ cairo_surface_destroy (srcImage);
+ cairo_destroy(targetContext);
+ ::DeleteObject(image);
+ image = 0;
+
+exit:
+ if (!hbmp)
+ hbmp = image;
+ if (dstDC)
+ DeleteDC(dstDC);
+ ReleaseDC(0, dc);
+ return hbmp;
}
DragImageRef createDragImageFromImage(Image* img)
{
- notImplemented();
+ HBITMAP hbmp = 0;
+ HDC dc = GetDC(0);
+ HDC workingDC = CreateCompatibleDC(dc);
+ if (!workingDC)
+ goto exit;
+
+ CairoContextRef drawContext = 0;
+ hbmp = allocImage(workingDC, img->size(), &drawContext);
+ if (!hbmp)
+ goto exit;
+
+ if (!drawContext) {
+ ::DeleteObject(hbmp);
+ hbmp = 0;
+ }
+
+ cairo_set_source_rgb (drawContext, 1.0, 0.0, 1.0);
+ cairo_fill_preserve (drawContext);
+
+ cairo_surface_t* srcImage = img->nativeImageForCurrentFrame();
+
+ // Draw the image.
+ cairo_set_source_surface(drawContext, srcImage, 0.0, 0.0);
+ cairo_paint(drawContext);
+
+ cairo_destroy (drawContext);
- return 0;
+exit:
+ if (workingDC)
+ DeleteDC(workingDC);
+ ReleaseDC(0, dc);
+ return hbmp;
}
}
diff --git a/WebCore/platform/win/LoggingWin.cpp b/WebCore/platform/win/LoggingWin.cpp
new file mode 100644
index 0000000..bb0e4f4
--- /dev/null
+++ b/WebCore/platform/win/LoggingWin.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+#include "PlatformString.h"
+#include <wtf/OwnArrayPtr.h>
+
+namespace WebCore {
+
+static inline void initializeWithUserDefault(WTFLogChannel& channel)
+{
+ DWORD length = GetEnvironmentVariableA(channel.defaultName, 0, 0);
+ if (!length)
+ return;
+
+ OwnArrayPtr<char> buffer(new char[length]);
+
+ if (!GetEnvironmentVariableA(channel.defaultName, buffer.get(), length))
+ return;
+
+ String variableValue(buffer.get());
+
+ static const String& hexadecimalPrefix = *new String("0x");
+ if (variableValue.length() < 3 || !variableValue.startsWith(hexadecimalPrefix, false)) {
+ LOG_ERROR("Unable to parse hex value for %s (%s), logging is off", channel.defaultName, buffer.get());
+ return;
+ }
+
+ String unprefixedValue = variableValue.substring(2);
+
+ // Now parse the unprefixed string as a hexadecimal number.
+ bool parsedSuccessfully = false;
+ unsigned logLevel = unprefixedValue.toUIntStrict(&parsedSuccessfully, 16);
+
+ if (!parsedSuccessfully) {
+ LOG_ERROR("Unable to parse hex value for %s (%s), logging is off", channel.defaultName, buffer.get());
+ return;
+ }
+
+ if ((logLevel & channel.mask) == channel.mask)
+ channel.state = WTFLogChannelOn;
+ else
+ channel.state = WTFLogChannelOff;
+}
+
+void InitializeLoggingChannelsIfNecessary()
+{
+ static bool haveInitializedLoggingChannels = false;
+ if (haveInitializedLoggingChannels)
+ return;
+ haveInitializedLoggingChannels = true;
+
+ initializeWithUserDefault(LogNotYetImplemented);
+ initializeWithUserDefault(LogFrames);
+ initializeWithUserDefault(LogLoading);
+ initializeWithUserDefault(LogPopupBlocking);
+ initializeWithUserDefault(LogEvents);
+ initializeWithUserDefault(LogEditing);
+ initializeWithUserDefault(LogTextConversion);
+ initializeWithUserDefault(LogIconDatabase);
+ initializeWithUserDefault(LogSQLDatabase);
+ initializeWithUserDefault(LogSpellingAndGrammar);
+ initializeWithUserDefault(LogBackForward);
+ initializeWithUserDefault(LogHistory);
+ initializeWithUserDefault(LogPageCache);
+ initializeWithUserDefault(LogPlatformLeaks);
+ initializeWithUserDefault(LogNetwork);
+ initializeWithUserDefault(LogFTP);
+ initializeWithUserDefault(LogThreading);
+ initializeWithUserDefault(LogStorageAPI);
+ initializeWithUserDefault(LogMedia);
+ initializeWithUserDefault(LogPlugin);
+ initializeWithUserDefault(LogArchives);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/win/MIMETypeRegistryWin.cpp b/WebCore/platform/win/MIMETypeRegistryWin.cpp
index 06c6f36..6885402 100644
--- a/WebCore/platform/win/MIMETypeRegistryWin.cpp
+++ b/WebCore/platform/win/MIMETypeRegistryWin.cpp
@@ -32,16 +32,6 @@
namespace WebCore
{
-String getMIMETypeForUTI(const String & uti)
-{
- String mimeType;
- // FIXME: This is an ugly hack: public.type -> image/type mimetype
- if (int dotLocation = uti.reverseFind('.')) {
- mimeType = String("image/")+uti.substring(dotLocation + 1);
- }
- return mimeType;
-}
-
static String mimeTypeForExtension(const String& extension)
{
String ext = "." + extension;
@@ -59,14 +49,6 @@ static String mimeTypeForExtension(const String& extension)
String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& type)
{
- String mimeType;
-
- int semiColonPos = type.find(';');
- if (semiColonPos < 0)
- mimeType = type;
- else
- mimeType = type.substring(0, semiColonPos);
-
String path = "MIME\\Database\\Content Type\\" + type;
WCHAR extStr[MAX_PATH];
DWORD extStrLen = sizeof(extStr);
@@ -109,6 +91,8 @@ String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
mimetypeMap.add("ico", "image/ico");
mimetypeMap.add("cur", "image/ico");
mimetypeMap.add("bmp", "image/bmp");
+ mimetypeMap.add("wml", "text/vnd.wap.wml");
+ mimetypeMap.add("wmlc", "application/vnd.wap.wmlc");
}
String result = mimetypeMap.get(ext);
if (result.isEmpty()) {
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index 64b8a59..59ea563 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -50,8 +50,6 @@ static const int defaultAnimationDuration = 200;
// Maximum height of a popup window
static const int maxPopupHeight = 320;
-static const int popupWindowAlphaPercent = 95;
-
const int optionSpacingMiddle = 1;
const int popupWindowBorderWidth = 1;
@@ -99,7 +97,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
if (!m_popup) {
registerPopup();
- DWORD exStyle = WS_EX_LAYERED | WS_EX_LTRREADING;
+ DWORD exStyle = WS_EX_LTRREADING;
// Even though we already know our size and location at this point, we pass (0,0,0,0) as our size/location here.
// We need to wait until after the call to ::SetWindowLongPtr to set our size so that in our WM_SIZE handler we can get access to the PopupMenu object
@@ -112,7 +110,6 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
return;
::SetWindowLongPtr(m_popup, 0, (LONG_PTR)this);
- ::SetLayeredWindowAttributes(m_popup, 0, (255 * popupWindowAlphaPercent) / 100, LWA_ALPHA);
}
if (!m_scrollbar)
@@ -526,13 +523,12 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
itemFont.update(m_popupClient->fontSelector());
}
- context.setFont(itemFont);
// Draw the item text
if (itemStyle.isVisible()) {
int textX = max(0, client()->clientPaddingLeft() - client()->clientInsetLeft());
int textY = itemRect.y() + itemFont.ascent() + (itemRect.height() - itemFont.height()) / 2;
- context.drawBidiText(textRun, IntPoint(textX, textY));
+ context.drawBidiText(itemFont, textRun, IntPoint(textX, textY));
}
}
diff --git a/WebCore/platform/win/SharedTimerWin.cpp b/WebCore/platform/win/SharedTimerWin.cpp
index b611659..da27a53 100644
--- a/WebCore/platform/win/SharedTimerWin.cpp
+++ b/WebCore/platform/win/SharedTimerWin.cpp
@@ -27,9 +27,9 @@
#include "SharedTimer.h"
#include "Page.h"
-#include "SystemTime.h"
#include "Widget.h"
#include <wtf/Assertions.h>
+#include <wtf/CurrentTime.h>
// Note: wx headers set defines that affect the configuration of windows.h
// so we must include the wx header first to get unicode versions of functions,
@@ -41,6 +41,10 @@
#include <windows.h>
#include <mmsystem.h>
+#if PLATFORM(WIN)
+#include "PluginView.h"
+#endif
+
// These aren't in winuser.h with the MSVS 2003 Platform SDK,
// so use default values in that case.
#ifndef USER_TIMER_MINIMUM
@@ -55,10 +59,6 @@
#define QS_RAWINPUT 0x0400
#endif
-#if PLATFORM(WIN)
-#include "PluginView.h"
-#endif
-
namespace WebCore {
static UINT timerID;
@@ -68,7 +68,6 @@ static HWND timerWindowHandle = 0;
static UINT timerFiredMessage = 0;
static HANDLE timerQueue;
static HANDLE timer;
-static Mutex timerMutex;
static bool highResTimerActive;
static bool processingCustomTimerMessage = false;
static LONG pendingTimers;
@@ -139,17 +138,8 @@ void setSharedTimerFiredFunction(void (*f)())
sharedTimerFiredFunction = f;
}
-static void clearTimer()
-{
- MutexLocker locker(timerMutex);
- if (timerQueue && timer)
- DeleteTimerQueueTimer(timerQueue, timer, 0);
- timer = 0;
-}
-
static void NTAPI queueTimerProc(PVOID, BOOLEAN)
{
- clearTimer();
if (InterlockedIncrement(&pendingTimers) == 1)
PostMessage(timerWindowHandle, timerFiredMessage, 0, 0);
}
@@ -196,11 +186,9 @@ void setSharedTimerFireTime(double fireTime)
// Otherwise, delay the PostMessage via a CreateTimerQueueTimer
if (!timerQueue)
timerQueue = CreateTimerQueue();
- MutexLocker locker(timerMutex);
if (timer)
- timerSet = ChangeTimerQueueTimer(timerQueue, timer, intervalInMS, 0);
- else
- timerSet = CreateTimerQueueTimer(&timer, timerQueue, queueTimerProc, 0, intervalInMS, 0, WT_EXECUTEINTIMERTHREAD | WT_EXECUTEONLYONCE);
+ DeleteTimerQueueTimer(timerQueue, timer, 0);
+ timerSet = CreateTimerQueueTimer(&timer, timerQueue, queueTimerProc, 0, intervalInMS, 0, WT_EXECUTEINTIMERTHREAD | WT_EXECUTEONLYONCE);
}
}
@@ -209,13 +197,19 @@ void setSharedTimerFireTime(double fireTime)
KillTimer(timerWindowHandle, timerID);
timerID = 0;
}
- } else
+ } else {
timerID = SetTimer(timerWindowHandle, sharedTimerID, intervalInMS, 0);
+ timer = 0;
+ }
}
void stopSharedTimer()
{
- clearTimer();
+ if (timerQueue && timer) {
+ DeleteTimerQueueTimer(timerQueue, timer, 0);
+ timer = 0;
+ }
+
if (timerID) {
KillTimer(timerWindowHandle, timerID);
timerID = 0;
diff --git a/WebCore/platform/win/SystemTimeWin.cpp b/WebCore/platform/win/SystemTimeWin.cpp
index 473e8de..88ea145 100644
--- a/WebCore/platform/win/SystemTimeWin.cpp
+++ b/WebCore/platform/win/SystemTimeWin.cpp
@@ -26,30 +26,23 @@
#include "config.h"
#include "SystemTime.h"
-#include <DateMath.h>
#include <windows.h>
-#if COMPILER(MINGW)
+#if COMPILER(MINGW) || (PLATFORM(QT) && COMPILER(MSVC))
#include <float.h>
#define FLOAT_MAX FLT_MAX
#endif
namespace WebCore {
-double currentTime()
-{
- // Call through to our high-resolution JSC time code, since calls like GetSystemTimeAsFileTime and ftime are only accurate within 15ms.
- // This resolution can be improved with timeBeginPeriod/timeEndPeriod on Vista, but these calls don't
- // improve the resolution of date/time getters (GetSystemTimeAsFileTime, ftime, etc.) on XP.
- return JSC::getCurrentUTCTimeWithMicroseconds() * 0.001;
-}
-
float userIdleTime()
{
+#if !PLATFORM(WIN_CE)
LASTINPUTINFO lastInputInfo = {0};
lastInputInfo.cbSize = sizeof(LASTINPUTINFO);
if (::GetLastInputInfo(&lastInputInfo))
return (GetTickCount() - lastInputInfo.dwTime) * 0.001; // ::GetTickCount returns ms of uptime valid for up to 49.7 days.
+#endif
return FLT_MAX; // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed.
}
diff --git a/WebCore/platform/win/TemporaryLinkStubs.cpp b/WebCore/platform/win/TemporaryLinkStubs.cpp
index 80c8df0..71eed00 100644
--- a/WebCore/platform/win/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/win/TemporaryLinkStubs.cpp
@@ -33,5 +33,7 @@ namespace WebCore {
// <keygen>
String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); }
void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
-
+#if PLATFORM(CAIRO)
+void populateFontDatabase() { /* Not needed for GDI fonts */ }
+#endif
} // namespace WebCore
diff --git a/WebCore/platform/win/WebCoreTextRenderer.cpp b/WebCore/platform/win/WebCoreTextRenderer.cpp
index 75ce003..affeb9d 100644
--- a/WebCore/platform/win/WebCoreTextRenderer.cpp
+++ b/WebCore/platform/win/WebCoreTextRenderer.cpp
@@ -52,10 +52,8 @@ static void doDrawTextAtPoint(GraphicsContext& context, const String& text, cons
context.setFillColor(color);
if (isOneLeftToRightRun(run))
font.drawText(&context, run, point);
- else {
- context.setFont(font);
- context.drawBidiText(run, point);
- }
+ else
+ context.drawBidiText(font, run, point);
if (underlinedIndex >= 0) {
ASSERT(underlinedIndex < static_cast<int>(text.length()));