Title: [116561] trunk/Source
Revision
116561
Author
[email protected]
Date
2012-05-09 15:06:27 -0700 (Wed, 09 May 2012)

Log Message

[Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
https://bugs.webkit.org/show_bug.cgi?id=84417

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/graphics/chromium/ImageChromium.cpp:
(WebCore::Image::loadPlatformResource):
* platform/graphics/chromium/ImageChromiumMac.mm: Removed.

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116560 => 116561)


--- trunk/Source/WebCore/ChangeLog	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/ChangeLog	2012-05-09 22:06:27 UTC (rev 116561)
@@ -1,3 +1,20 @@
+2012-05-09  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
+        https://bugs.webkit.org/show_bug.cgi?id=84417
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+        * platform/graphics/chromium/ImageChromium.cpp:
+        (WebCore::Image::loadPlatformResource):
+        * platform/graphics/chromium/ImageChromiumMac.mm: Removed.
+
 2012-05-09  Rob Buis  <[email protected]>
 
         Remove some isSVGFoo methods

Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (116560 => 116561)


--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-05-09 22:06:27 UTC (rev 116561)
@@ -1654,7 +1654,6 @@
             ['include', 'platform/graphics/cg/IntPointCG\\.cpp$'],
             ['include', 'platform/graphics/cg/IntRectCG\\.cpp$'],
             ['include', 'platform/graphics/cg/IntSizeCG\\.cpp$'],
-            ['exclude', 'platform/graphics/chromium/ImageChromiumMac\\.mm$'],
             ['exclude', 'platform/graphics/mac/FontMac\\.mm$'],
             ['exclude', 'platform/graphics/skia/FontCacheSkia\\.cpp$'],
             ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],

Modified: trunk/Source/WebCore/WebCore.gypi (116560 => 116561)


--- trunk/Source/WebCore/WebCore.gypi	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/WebCore.gypi	2012-05-09 22:06:27 UTC (rev 116561)
@@ -3568,7 +3568,6 @@
             'platform/graphics/chromium/IconChromiumAndroid.cpp',
             'platform/graphics/chromium/ImageBufferDataSkia.h',
             'platform/graphics/chromium/ImageChromium.cpp',
-            'platform/graphics/chromium/ImageChromiumMac.mm',
             'platform/graphics/chromium/ImageLayerChromium.cpp',
             'platform/graphics/chromium/ImageLayerChromium.h',
             'platform/graphics/chromium/LayerChromium.cpp',

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (116560 => 116561)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-05-09 22:06:27 UTC (rev 116561)
@@ -196,8 +196,6 @@
     static bool popupsAllowed(NPP);
 
     // Resources ----------------------------------------------------------
-    static PassRefPtr<Image> loadPlatformImageResource(const char* name);
-
 #if ENABLE(WEB_AUDIO)
     static PassOwnPtr<AudioBus> decodeAudioFileData(const char* data, size_t, double sampleRate);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp (116560 => 116561)


--- trunk/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp	2012-05-09 22:06:27 UTC (rev 116561)
@@ -29,9 +29,12 @@
  */
 
 #include "config.h"
+#include "BitmapImage.h"
 #include "Image.h"
+#include "SharedBuffer.h"
 
-#include "PlatformSupport.h"
+#include <public/Platform.h>
+#include <public/WebData.h>
 
 namespace WebCore {
 
@@ -39,7 +42,13 @@
 
 PassRefPtr<Image> Image::loadPlatformResource(const char *name)
 {
-    return PlatformSupport::loadPlatformImageResource(name);
+    const WebKit::WebData& resource = WebKit::Platform::current()->loadResource(name);
+    if (resource.isEmpty())
+        return Image::nullImage();
+
+    RefPtr<Image> image = BitmapImage::create();
+    image->setData(resource, true);
+    return image.release();
 }
 
 } // namespace WebCore

Deleted: trunk/Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm (116560 => 116561)


--- trunk/Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm	2012-05-09 22:06:27 UTC (rev 116561)
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, Google 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:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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.
- */
-
-// A wrapper around Uniscribe that provides a reasonable API.
-
-#include "config.h"
-#include "BitmapImage.h"
-
-#include "Image.h"
-#include "PlatformSupport.h"
-
-namespace WebCore {
-
-PassRefPtr<Image> Image::loadPlatformResource(const char* name)
-{
-    return PlatformSupport::loadPlatformImageResource(name);
-}
-
-// FIXME: These are temporary stubs, we need real implementations which
-// may come in the form of ImageChromium.cpp.  The Windows Chromium
-// implementation is currently in ImageSkia.cpp.
- 
-void BitmapImage::initPlatformData()
-{
-}
-
-void BitmapImage::invalidatePlatformData()
-{
-}
-
-}  // namespace WebCore

Modified: trunk/Source/WebKit/chromium/ChangeLog (116560 => 116561)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-09 22:06:27 UTC (rev 116561)
@@ -1,3 +1,15 @@
+2012-05-09  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
+        https://bugs.webkit.org/show_bug.cgi?id=84417
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * src/PlatformSupport.cpp:
+        (WebCore):
+
 2012-05-09  Jochen Eisinger  <[email protected]>
 
         [chromium] remove the obsolete WebFrame::referrerPolicy method

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (116560 => 116561)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-09 22:01:09 UTC (rev 116560)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-09 22:06:27 UTC (rev 116561)
@@ -553,17 +553,6 @@
 
 // Resources ------------------------------------------------------------------
 
-PassRefPtr<Image> PlatformSupport::loadPlatformImageResource(const char* name)
-{
-    const WebData& resource = webKitPlatformSupport()->loadResource(name);
-    if (resource.isEmpty())
-        return Image::nullImage();
-
-    RefPtr<Image> image = BitmapImage::create();
-    image->setData(resource, true);
-    return image;
-}
-
 #if ENABLE(WEB_AUDIO)
 
 PassOwnPtr<AudioBus> PlatformSupport::decodeAudioFileData(const char* data, size_t size, double sampleRate)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to