Changeset 120789 in webkit


Ignore:
Timestamp:
Jun 19, 2012 7:15:00 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Add monitor profile support for Win
https://bugs.webkit.org/show_bug.cgi?id=88565

Patch by Tony Payne <tpayne@chromium.org> on 2012-06-19
Reviewed by Eric Seidel.

Source/Platform:

  • chromium/public/Platform.h:

(Platform):
(WebKit::Platform::screenColorProfile):

Source/WebCore:

Tests: fast/images/jpeg-with-color-profile.html
fast/images/png-with-color-profile.html. Also covered by numerous
layout tests.

  • WebCore.gyp/WebCore.gyp:
  • platform/PlatformScreen.h:

(WebCore):

  • platform/blackberry/PlatformScreenBlackBerry.cpp:

(WebCore::screenColorProfile):
(WebCore):

  • platform/chromium/PlatformScreenChromium.cpp:

(WebCore::screenColorProfile):
(WebCore):

  • platform/efl/PlatformScreenEfl.cpp:

(WebCore::screenColorProfile):
(WebCore):

  • platform/gtk/PlatformScreenGtk.cpp:

(WebCore::screenColorProfile):
(WebCore):

  • platform/image-decoders/ImageDecoder.h:

(ImageFrame):
(ImageDecoder):
(WebCore::ImageDecoder::qcmsOutputDeviceProfile):

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:

(turboSwizzled):
(colorSpaceHasAlpha):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r120644 r120789  
     12012-06-19  Tony Payne  <tpayne@chromium.org>
     2
     3        Add monitor profile support for Win
     4        https://bugs.webkit.org/show_bug.cgi?id=88565
     5
     6        Reviewed by Eric Seidel.
     7
     8        * chromium/public/Platform.h:
     9        (Platform):
     10        (WebKit::Platform::screenColorProfile):
     11
    1122012-06-14  James Robinson  <jamesr@chromium.org>
    213
  • trunk/Source/Platform/chromium/public/Platform.h

    r119666 r120789  
    3939#include "WebLocalizedString.h"
    4040#include "WebString.h"
     41#include "WebVector.h"
    4142
    4243namespace WebKit {
     
    238239    // sandbox isn't active).
    239240    virtual bool sandboxEnabled() { return false; }
     241
     242
     243    // Screen -------------------------------------------------------------
     244
     245    // Supplies the system monitor color profile ("monitor") or a named ICC profile.
     246    virtual void screenColorProfile(const WebString& type, WebVector<char>* profile) { }
    240247
    241248
  • trunk/Source/WebCore/ChangeLog

    r120783 r120789  
     12012-06-19  Tony Payne  <tpayne@chromium.org>
     2
     3        Add monitor profile support for Win
     4        https://bugs.webkit.org/show_bug.cgi?id=88565
     5
     6        Reviewed by Eric Seidel.
     7
     8        Tests: fast/images/jpeg-with-color-profile.html
     9        fast/images/png-with-color-profile.html. Also covered by numerous
     10        layout tests.
     11
     12        * WebCore.gyp/WebCore.gyp:
     13        * platform/PlatformScreen.h:
     14        (WebCore):
     15        * platform/blackberry/PlatformScreenBlackBerry.cpp:
     16        (WebCore::screenColorProfile):
     17        (WebCore):
     18        * platform/chromium/PlatformScreenChromium.cpp:
     19        (WebCore::screenColorProfile):
     20        (WebCore):
     21        * platform/efl/PlatformScreenEfl.cpp:
     22        (WebCore::screenColorProfile):
     23        (WebCore):
     24        * platform/gtk/PlatformScreenGtk.cpp:
     25        (WebCore::screenColorProfile):
     26        (WebCore):
     27        * platform/image-decoders/ImageDecoder.h:
     28        (ImageFrame):
     29        (ImageDecoder):
     30        (WebCore::ImageDecoder::qcmsOutputDeviceProfile):
     31        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
     32        (turboSwizzled):
     33        (colorSpaceHasAlpha):
     34
    1352012-06-19  Erik Arvidsson  <arv@chromium.org>
    236
  • trunk/Source/WebCore/platform/PlatformScreen.h

    r106678 r120789  
    3838typedef uint32_t PlatformDisplayID;
    3939
     40typedef WTF::Vector<char> ColorProfile;
     41
    4042namespace WebCore {
    4143
     
    5153    FloatRect screenRect(Widget*);
    5254    FloatRect screenAvailableRect(Widget*);
     55    // type can be "monitor" or the name of a profile such as "sRGB" or "Adobe RGB".
     56    void screenColorProfile(Widget*, const String& type, ColorProfile&);
    5357
    5458#if PLATFORM(MAC)
  • trunk/Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp

    r117724 r120789  
    6565}
    6666
     67void screenColorProfile(Widget*, const String&, ColorProfile&)
     68{
     69    notImplemented();
     70}
     71
    6772} // namespace WebCore
  • trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp

    r106678 r120789  
    3434#include "IntRect.h"
    3535#include "PlatformSupport.h"
     36
     37#include <public/Platform.h>
    3638
    3739namespace WebCore {
     
    7274}
    7375
     76void screenColorProfile(Widget*, const String& type, ColorProfile& toProfile)
     77{
     78    // FIXME: Add support for multiple monitors.
     79    WebKit::WebVector<char> profile;
     80    WebKit::Platform::current()->screenColorProfile(WebKit::WebString(type), &profile);
     81    toProfile.append(profile.data(), profile.size());
     82}
     83
    7484} // namespace WebCore
  • trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp

    r106678 r120789  
    9393}
    9494
     95void screenColorProfile(Widget*, const String&, ColorProfile&)
     96{
     97    notImplemented();
    9598}
     99
     100}
  • trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp

    r106678 r120789  
    138138}
    139139
     140void screenColorProfile(Widget*, const String&, ColorProfile&)
     141{
     142    notImplemented();
     143}
     144
    140145} // namespace WebCore
  • trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h

    r120613 r120789  
    3232#include "IntRect.h"
    3333#include "ImageSource.h"
     34#include "PlatformScreen.h"
    3435#include "PlatformString.h"
    3536#include "SharedBuffer.h"
     
    4546#if USE(QCMSLIB)
    4647#include "qcms.h"
    47 #include <wtf/MainThread.h>
    4848#if OS(DARWIN)
    4949#include "GraphicsContextCG.h"
     
    5454
    5555namespace WebCore {
    56 
    57     typedef Vector<char> ColorProfile;
    5856
    5957    // ImageFrame represents the decoded image data.  This buffer is what all
     
    314312                    const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile);
    315313                    outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
    316                     if (outputDeviceProfile && qcms_profile_is_bogus(outputDeviceProfile)) {
    317                         qcms_profile_release(outputDeviceProfile);
    318                         outputDeviceProfile = 0;
    319                     }
     314                }
     315#else
     316                // FIXME: add support for multiple monitors.
     317                ColorProfile profile;
     318                screenColorProfile(0, "monitor", profile);
     319                if (!profile.isEmpty())
     320                    outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size());
     321#endif
     322                if (outputDeviceProfile && qcms_profile_is_bogus(outputDeviceProfile)) {
     323                    qcms_profile_release(outputDeviceProfile);
     324                    outputDeviceProfile = 0;
    320325                }
    321326                if (!outputDeviceProfile)
    322327                    outputDeviceProfile = qcms_profile_sRGB();
    323 #else
    324                 // FIXME: sRGB profiles don't add much value. Use the user's monitor profile.
    325                 outputDeviceProfile = qcms_profile_sRGB();
    326 #endif
    327                 // FIXME: Check that the profile is valid. Fallback to sRGB if not?
    328328                if (outputDeviceProfile)
    329329                    qcms_profile_precache_output_transform(outputDeviceProfile);
  • trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm

    r106678 r120789  
    7777}
    7878
     79void screenColorProfile(Widget*, const String&, ColorProfile&)
     80{
     81    notImplemented();
     82}
     83
    7984NSScreen *screenForWindow(NSWindow *window)
    8085{
  • trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp

    r119098 r120789  
    144144}
    145145
     146void screenColorProfile(Widget*, const String&, ColorProfile&)
     147{
     148    notImplemented();
     149}
     150
    146151} // namespace WebCore
  • trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp

    r106678 r120789  
    119119}
    120120
     121void screenColorProfile(Widget*, const String&, ColorProfile&)
     122{
     123    notImplemented();
     124}
     125
    121126} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.