diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 05:38:46 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 05:38:46 +0000 |
commit | 0e0126401261fee4d69237b489f672e933bcfb71 (patch) | |
tree | 47665b1871516b8e2466cf7084af47307ce44add | |
parent | 64d7a42850c7b5fd2890f436573ebec5b9ce949e (diff) | |
download | chromium_src-0e0126401261fee4d69237b489f672e933bcfb71.zip chromium_src-0e0126401261fee4d69237b489f672e933bcfb71.tar.gz chromium_src-0e0126401261fee4d69237b489f672e933bcfb71.tar.bz2 |
Start compiling a bunch of *Chromium.cpp files in our port on
linux. More will come once we stop using PLATFORM_GTK_.
Review URL: http://codereview.chromium.org/7606
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3513 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 2 | ||||
-rw-r--r-- | webkit/SConscript.port | 15 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 10 | ||||
-rw-r--r-- | webkit/port/page/chromium/FrameChromium.cpp | 1 | ||||
-rw-r--r-- | webkit/port/platform/chromium/DragImageChromium.cpp | 6 | ||||
-rw-r--r-- | webkit/port/platform/chromium/FileChooserChromium.cpp | 2 | ||||
-rw-r--r-- | webkit/port/platform/chromium/TextBoundariesChromium.cpp | 2 | ||||
-rw-r--r-- | webkit/port/platform/graphics/GraphicsContextSkia.cpp | 23 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 2 |
9 files changed, 29 insertions, 34 deletions
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 9de5f15..244646e 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -84,7 +84,7 @@ void webkit_glue::AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } -bool webkit_glue::GetMimeTypeFromExtension(std::wstring &ext, +bool webkit_glue::GetMimeTypeFromExtension(const std::wstring &ext, std::string *mime_type) { if (IsPluginProcess()) return net::GetMimeTypeFromExtension(ext, mime_type); diff --git a/webkit/SConscript.port b/webkit/SConscript.port index 0fd7279..8d31e02 100644 --- a/webkit/SConscript.port +++ b/webkit/SConscript.port @@ -119,34 +119,19 @@ if env['PLATFORM'] in ('posix', 'darwin'): # Remove from the list files that haven't yet been made portable # to Mac and Linux. remove_files = [ - '$PORT_DIR/bridge/chromium/PluginsChromium.cpp', '$PORT_DIR/platform/network/chromium/NetworkStateNotifierChromium.cpp', - '$PORT_DIR/page/chromium/AccessibilityObjectChromium.cpp', '$PORT_DIR/page/chromium/AXObjectCacheChromium.cpp', '$PORT_DIR/page/chromium/DragControllerChromium.cpp', '$PORT_DIR/page/chromium/EventHandlerChromium.cpp', - '$PORT_DIR/page/chromium/FrameChromium.cpp', '$PORT_DIR/platform/chromium/ContextMenuItemChromium.cpp', - '$PORT_DIR/platform/chromium/ContextMenuChromium.cpp', '$PORT_DIR/platform/chromium/CursorChromium.cpp', '$PORT_DIR/platform/chromium/DragDataChromium.cpp', - '$PORT_DIR/platform/chromium/DragImageChromium.cpp', - '$PORT_DIR/platform/chromium/FileChooserChromium.cpp', - '$PORT_DIR/platform/chromium/MimeTypeRegistryChromium.cpp', '$PORT_DIR/platform/chromium/PlatformScrollBarChromium.cpp', '$PORT_DIR/platform/chromium/PopupMenuChromium.cpp', - '$PORT_DIR/platform/chromium/SSLKeyGeneratorChromium.cpp', '$PORT_DIR/platform/chromium/ScrollViewChromium.cpp', - '$PORT_DIR/platform/chromium/SearchPopupMenuChromium.cpp', - '$PORT_DIR/platform/chromium/SharedTimerChromium.cpp', - '$PORT_DIR/platform/chromium/SystemTimeChromium.cpp', - '$PORT_DIR/platform/chromium/TextBoundariesChromium.cpp', - '$PORT_DIR/platform/chromium/TextBreakIteratorInternalICUChromium.cpp', '$PORT_DIR/platform/chromium/WidgetChromium.cpp', '$PORT_DIR/platform/graphics/FontCustomPlatformData.cpp', - '$PORT_DIR/platform/graphics/GraphicsContextSkia.cpp', '$PORT_DIR/platform/graphics/ImageSkia.cpp', - '$PORT_DIR/platform/graphics/PlatformContextSkia.cpp', '$PORT_DIR/platform/graphics/SkGraphicsContext.cpp', ] for remove in remove_files: diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 8263f74..3424ee6 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -129,16 +129,16 @@ void AppendToLog(const char* filename, int line, const char* message); // Get the mime type (if any) that is associated with the given file extension. // Returns true if a corresponding mime type exists. -bool GetMimeTypeFromExtension(std::wstring &ext, std::string *mime_type); +bool GetMimeTypeFromExtension(const std::wstring& ext, std::string* mime_type); // Get the mime type (if any) that is associated with the given file. // Returns true if a corresponding mime type exists. -bool GetMimeTypeFromFile(const std::wstring &file_path, std::string *mime_type); +bool GetMimeTypeFromFile(const std::wstring& file_path, std::string* mime_type); // Get the preferred extension (if any) associated with the given mime type. // Returns true if a corresponding file extension exists. bool GetPreferredExtensionForMimeType(const std::string& mime_type, - std::wstring *ext); + std::wstring* ext); #ifdef _WIN32 // Returns the com object pointer for the FontLink interface @@ -219,7 +219,7 @@ void ClipboardReadHTML(std::wstring* markup, GURL* url); // GetExeDirectory(), depending on the embedder's implementation. // Path is an output parameter to receive the path. // Returns true if successful, false otherwise. -bool GetApplicationDirectory(std::wstring *path); +bool GetApplicationDirectory(std::wstring* path); // Gets the URL where the inspector's HTML file resides. It must use the // protocol returned by GetUIResourceProtocol. @@ -232,7 +232,7 @@ std::string GetUIResourceProtocol(); // Gets the directory where the launching executable resides on disk. // Path is an output parameter to receive the path. // Returns true if successful, false otherwise. -bool GetExeDirectory(std::wstring *path); +bool GetExeDirectory(std::wstring* path); // Embedders implement this function to return the list of plugins to Webkit. bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); diff --git a/webkit/port/page/chromium/FrameChromium.cpp b/webkit/port/page/chromium/FrameChromium.cpp index 991401e..eb0912b 100644 --- a/webkit/port/page/chromium/FrameChromium.cpp +++ b/webkit/port/page/chromium/FrameChromium.cpp @@ -78,7 +78,6 @@ void computePageRectsForFrame(Frame* frame, const IntRect& printRect, float head float currPageHeight = pageHeight / userScaleFactor; float docHeight = root->layer()->height(); - float docWidth = root->layer()->width(); float currPageWidth = pageWidth / userScaleFactor; diff --git a/webkit/port/platform/chromium/DragImageChromium.cpp b/webkit/port/platform/chromium/DragImageChromium.cpp index e3bc70e..5ec6b97 100644 --- a/webkit/port/platform/chromium/DragImageChromium.cpp +++ b/webkit/port/platform/chromium/DragImageChromium.cpp @@ -32,6 +32,8 @@ #if PLATFORM(WIN) #include <windows.h> +#else +#include "NotImplemented.h" #endif namespace WebCore { @@ -54,8 +56,12 @@ IntSize dragImageSize(DragImageRef image) void deleteDragImage(DragImageRef image) { +#if PLATFORM(WIN) if (image) ::DeleteObject(image); +#else + notImplemented(); +#endif } DragImageRef scaleDragImage(DragImageRef image, FloatSize scale) diff --git a/webkit/port/platform/chromium/FileChooserChromium.cpp b/webkit/port/platform/chromium/FileChooserChromium.cpp index aed99d7..fb15349 100644 --- a/webkit/port/platform/chromium/FileChooserChromium.cpp +++ b/webkit/port/platform/chromium/FileChooserChromium.cpp @@ -24,7 +24,9 @@ */ #include "config.h" +#if PLATFORM(WIN_OS) #include <shlwapi.h> +#endif #pragma warning(push, 0) #include "ChromeClientChromium.h" diff --git a/webkit/port/platform/chromium/TextBoundariesChromium.cpp b/webkit/port/platform/chromium/TextBoundariesChromium.cpp index e633f9b..d226048 100644 --- a/webkit/port/platform/chromium/TextBoundariesChromium.cpp +++ b/webkit/port/platform/chromium/TextBoundariesChromium.cpp @@ -37,8 +37,6 @@ int findNextWordFromIndex(const UChar* chars, int len, int position, bool forwar { UBreakIterator* it = wordBreakIterator(chars, len); - int newPosition = position; - if (forward) { position = ubrk_following(it, position); while (position != UBRK_DONE) { diff --git a/webkit/port/platform/graphics/GraphicsContextSkia.cpp b/webkit/port/platform/graphics/GraphicsContextSkia.cpp index d282555..9beade1 100644 --- a/webkit/port/platform/graphics/GraphicsContextSkia.cpp +++ b/webkit/port/platform/graphics/GraphicsContextSkia.cpp @@ -35,7 +35,7 @@ #include "SkBitmap.h" -#include "base/gfx/platform_canvas_win.h" +#include "base/gfx/platform_canvas.h" using namespace std; @@ -59,7 +59,11 @@ static bool IsCoordinateReasonable(float coord) { #ifdef CHECK_REASONABLE // First check for valid floats. +#if defined(COMPILER_MSVC) if (!_finite(coord)) +#else + if (!finite(coord)) +#endif return false; // Skia uses 16.16 fixed point and 26.6 fixed point in various places. If @@ -167,10 +171,10 @@ void add_corner_arc(SkPath* path, const SkRect& rect, const IntSize& size, int s path->arcTo(r, SkIntToScalar(startAngle), SkIntToScalar(90), false); } -COMPILE_ASSERT(GraphicsContextPlatformPrivate::NoStroke == NoStroke, AssertNoStroke); -COMPILE_ASSERT(GraphicsContextPlatformPrivate::SolidStroke == SolidStroke, AssertSolidStroke); -COMPILE_ASSERT(GraphicsContextPlatformPrivate::DottedStroke == DottedStroke, AssertDottedStroke); -COMPILE_ASSERT(GraphicsContextPlatformPrivate::DashedStroke == DashedStroke, AssertDashedStroke); +COMPILE_ASSERT(static_cast<int>(GraphicsContextPlatformPrivate::NoStroke) == static_cast<int>(NoStroke), AssertNoStroke); +COMPILE_ASSERT(static_cast<int>(GraphicsContextPlatformPrivate::SolidStroke) == static_cast<int>(SolidStroke), AssertSolidStroke); +COMPILE_ASSERT(static_cast<int>(GraphicsContextPlatformPrivate::DottedStroke) == static_cast<int>(DottedStroke), AssertDottedStroke); +COMPILE_ASSERT(static_cast<int>(GraphicsContextPlatformPrivate::DashedStroke) == static_cast<int>(DashedStroke), AssertDashedStroke); // Note: Remove this function as soon as StrokeStyle is moved in GraphicsTypes.h. GraphicsContextPlatformPrivate::StrokeStyle StrokeStyle2StrokeStyle(StrokeStyle style) @@ -572,7 +576,7 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) GraphicsContext* GraphicsContext::createOffscreenContext(int width, int height) { - gfx::PlatformCanvasWin* canvas = new gfx::PlatformCanvasWin(width, height, false); + gfx::PlatformCanvas* canvas = new gfx::PlatformCanvas(width, height, false); PlatformContextSkia* pgc = new PlatformContextSkia(canvas); canvas->drawARGB(0, 0, 0, 0, SkPorterDuff::kClear_Mode); @@ -791,9 +795,6 @@ void GraphicsContext::beginTransparencyLayer(float opacity) if (paintingDisabled()) return; - SkDevice* old_device = m_data->canvas()->getDevice(); - const SkBitmap& old_bitmap = old_device->accessBitmap(false); - // We need the "alpha" layer flag here because the base layer is opaque // (the surface of the page) but layers on top may have transparent parts. // Without explicitly setting the alpha flag, the layer will inherit the @@ -810,7 +811,9 @@ void GraphicsContext::endTransparencyLayer() if (paintingDisabled()) return; +#if PLATFORM(WIN_OS) m_data->canvas()->getTopPlatformDevice().fixupAlphaBeforeCompositing(); +#endif m_data->canvas()->restore(); } @@ -978,6 +981,7 @@ AffineTransform GraphicsContext::getCTM() const return m_data->canvas()->getTotalMatrix(); } +#if PLATFORM(WIN_OS) HDC GraphicsContext::getWindowsContext(const IntRect&, bool supportAlphaBlend, bool mayCreateBitmap) { if (paintingDisabled()) @@ -990,6 +994,7 @@ void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect&, bool suppor { // noop, the DC will be lazily freed by the bitmap when no longer needed } +#endif static inline float square(float n) { diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index bbdc21e..80c9549 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -1012,7 +1012,7 @@ void AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } -bool GetMimeTypeFromExtension(std::wstring &ext, std::string *mime_type) { +bool GetMimeTypeFromExtension(const std::wstring &ext, std::string *mime_type) { return net::GetMimeTypeFromExtension(ext, mime_type); } |