From 7d469684fd27bfc8aae770eabb31a4349969aec2 Mon Sep 17 00:00:00 2001 From: "fsamuel@chromium.org" Date: Wed, 28 Sep 2011 17:36:03 +0000 Subject: [PATCH] [Chromium] Seperate GTK specific Gyp rules from X11 Gyp rules https://bugs.webkit.org/show_bug.cgi?id=68936 Reviewed by Tony Chang. Source/WebCore: Chromium need to be built without Gtk for future version of ChromiumOS. * WebCore.gyp/WebCore.gyp: Source/WebKit/chromium: * WebKit.gyp: * public/gtk/WebFontInfo.h: * public/linux/WebFontInfo.h: Copied from Source/WebKit/chromium/public/gtk/WebFontInfo.h. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96233 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 11 ++++ Source/WebCore/WebCore.gyp/WebCore.gyp | 54 ++++++++++++----- Source/WebKit/chromium/ChangeLog | 11 ++++ Source/WebKit/chromium/WebKit.gyp | 39 +++++++++---- Source/WebKit/chromium/public/gtk/WebFontInfo.h | 47 ++------------- Source/WebKit/chromium/public/linux/WebFontInfo.h | 71 +++++++++++++++++++++++ 6 files changed, 164 insertions(+), 69 deletions(-) create mode 100644 Source/WebKit/chromium/public/linux/WebFontInfo.h diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 614ddf6..4de3b19 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2011-09-28 Fady Samuel + + [Chromium] Seperate GTK specific Gyp rules from X11 Gyp rules + https://bugs.webkit.org/show_bug.cgi?id=68936 + + Reviewed by Tony Chang. + + Chromium need to be built without Gtk for future version of ChromiumOS. + + * WebCore.gyp/WebCore.gyp: + 2011-09-28 Tom Sepez Revert change which broke displaying end script tags in view-source, instead diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp index c16855f..b30e711 100644 --- a/Source/WebCore/WebCore.gyp/WebCore.gyp +++ b/Source/WebCore/WebCore.gyp/WebCore.gyp @@ -1133,14 +1133,12 @@ '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', ], }], - ['toolkit_uses_gtk == 1', { + ['use_x11 == 1', { 'dependencies': [ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', - '<(chromium_src_dir)/build/linux/system.gyp:gtk', ], 'export_dependent_settings': [ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', - '<(chromium_src_dir)/build/linux/system.gyp:gtk', ], 'direct_dependent_settings': { 'cflags': [ @@ -1150,6 +1148,14 @@ ], }, }], + ['toolkit_uses_gtk == 1', { + 'dependencies': [ + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + }], ['OS=="linux"', { 'direct_dependent_settings': { 'defines': [ @@ -1367,18 +1373,32 @@ ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'], ], 'conditions': [ - ['toolkit_uses_gtk == 1', { + ['use_x11 == 1', { 'sources/': [ # Cherry-pick files excluded by the broader regular expressions above. - ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'], ['include', 'platform/graphics/chromium/ComplexTextControllerLinux\\.cpp$'], ['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'], ['include', 'platform/graphics/chromium/FontLinux\\.cpp$'], ['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'], ['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'], ], + }, { # use_x11==0 + 'sources/': [ + ['exclude', 'Linux\\.cpp$'], + ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'], + ], }], - ['toolkit_uses_gtk==1 or OS=="android"', { + ['toolkit_uses_gtk == 1', { + 'sources/': [ + # Cherry-pick files excluded by the broader regular expressions above. + ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'], + ], + }, { # toolkit_uses_gtk==0 + 'sources/': [ + ['exclude', 'Gtk\\.cpp$'], + ], + }], + ['use_x11==1 or OS=="android"', { 'dependencies': [ '<(chromium_src_dir)/third_party/harfbuzz/harfbuzz.gyp:harfbuzz', ], @@ -1518,13 +1538,7 @@ ['exclude', 'platform/chromium/DragImageChromiumMac\\.cpp$'], ], }], - ['toolkit_uses_gtk == 0', { - 'sources/': [ - ['exclude', '(Gtk|Linux)\\.cpp$'], - ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'], - ], - }], - ['toolkit_uses_gtk == 0 and (OS!="mac" or use_skia==0)', { + ['use_x11 == 0 and (OS!="mac" or use_skia==0)', { 'sources/': [ ['exclude', 'VDMX[^/]+\\.(cpp|h)$'], ], @@ -1623,9 +1637,14 @@ # warnings about uninitialized this. 'cflags': ['-Wno-uninitialized'], }], + ['use_x11 == 0', { + 'sources/': [ + ['exclude', 'Linux\\.cpp$'], + ], + }], ['toolkit_uses_gtk == 0', { 'sources/': [ - ['exclude', '(Gtk|Linux)\\.cpp$'], + ['exclude', 'Gtk\\.cpp$'], ], }], ['OS!="mac"', { @@ -1754,9 +1773,14 @@ # warnings about uninitialized this. 'cflags': ['-Wno-uninitialized'], }], + ['use_x11 == 0', { + 'sources/': [ + ['exclude', 'Linux\\.cpp$'], + ], + }], ['toolkit_uses_gtk == 0', { 'sources/': [ - ['exclude', '(Gtk|Linux)\\.cpp$'], + ['exclude', 'Gtk\\.cpp$'], ], }], ['OS!="mac"', { diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index a113354..cb886ed 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,14 @@ +2011-09-28 Fady Samuel + + [Chromium] Seperate GTK specific Gyp rules from X11 Gyp rules + https://bugs.webkit.org/show_bug.cgi?id=68936 + + Reviewed by Tony Chang. + + * WebKit.gyp: + * public/gtk/WebFontInfo.h: + * public/linux/WebFontInfo.h: Copied from Source/WebKit/chromium/public/gtk/WebFontInfo.h. + 2011-09-27 Sheriff Bot Unreviewed. Rolled DEPS. diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index 030b713..8c49129 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -691,24 +691,33 @@ }], ], }], - ['toolkit_uses_gtk == 1', { + ['use_x11 == 1', { 'dependencies': [ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', - '<(chromium_src_dir)/build/linux/system.gyp:gtk', '<(chromium_src_dir)/build/linux/system.gyp:x11', ], 'include_dirs': [ 'public/x11', - 'public/gtk', 'public/linux', ], - }, { # else: toolkit_uses_gtk != 1 + }, { # else: use_x11 != 1 'sources/': [ - ['exclude', '/gtk/'], ['exclude', '/x11/'], ['exclude', '/linux/'], ], }], + ['toolkit_uses_gtk == 1', { + 'dependencies': [ + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + 'include_dirs': [ + 'public/gtk', + ], + }, { # else: toolkit_uses_gtk != 1 + 'sources/': [ + ['exclude', '/gtk/'], + ], + }], ['OS=="android"', { 'include_dirs': [ 'public/android', @@ -1121,13 +1130,9 @@ ['exclude', 'Mac\\.cpp$'], ], }], - ['toolkit_uses_gtk == 1', { + ['use_x11 == 1', { 'dependencies': [ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', - '<(chromium_src_dir)/build/linux/system.gyp:gtk', - ], - 'include_dirs': [ - 'public/gtk', ], 'copies': [{ 'destination': '<(PRODUCT_DIR)', @@ -1148,9 +1153,21 @@ ], }], ], + },{ # use_x11 != 1 + 'sources/': [ + ['exclude', 'Linux\\.cpp$'] + ] + }], + ['toolkit_uses_gtk == 1', { + 'dependencies': [ + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + 'include_dirs': [ + 'public/gtk', + ], },{ # toolkit_uses_gtk != 1 'sources/': [ - ['exclude', '(Gtk|Linux)\\.cpp$'] + ['exclude', 'Gtk\\.cpp$'] ] }], ['OS!="android"', { diff --git a/Source/WebKit/chromium/public/gtk/WebFontInfo.h b/Source/WebKit/chromium/public/gtk/WebFontInfo.h index 5d52584..2fc00ba 100644 --- a/Source/WebKit/chromium/public/gtk/WebFontInfo.h +++ b/Source/WebKit/chromium/public/gtk/WebFontInfo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 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 @@ -27,45 +27,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef WebFontInfo_h -#define WebFontInfo_h - -#include "../WebCString.h" -#include "../linux/WebFontRenderStyle.h" - -#include -#include - -namespace WebKit { - -class WebFontInfo { -public: - // Return a font family which provides glyphs for the Unicode code points - // specified by |utf16| - // characters: a native-endian UTF16 string - // numCharacters: the number of 16-bit words in |utf16| - // preferredLocale: preferred locale identifier for the |characters| - // (e.g. "en", "ja", "zh-CN") - // - // Returns: the font family or an empty string if the request could not be - // satisfied. - WEBKIT_EXPORT static WebCString familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale); - - // Fill out the given WebFontRenderStyle with the user's preferences for - // rendering the given font at the given size. - // family: i.e. "Times New Roman" - // sizeAndStyle: - // 3322222222221111111111 - // 10987654321098765432109876543210 - // +--------------------------------+ - // |..............Size............IB| - // +--------------------------------+ - // I: italic flag - // B: bold flag - WEBKIT_EXPORT static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); -}; - -} // namespace WebKit - -#endif +// This file can be deleted once http://codereview.chromium.org/8054025/ +// gets committed in Chromium. +#include "../linux/WebFontInfo.h" diff --git a/Source/WebKit/chromium/public/linux/WebFontInfo.h b/Source/WebKit/chromium/public/linux/WebFontInfo.h new file mode 100644 index 0000000..5d52584 --- /dev/null +++ b/Source/WebKit/chromium/public/linux/WebFontInfo.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 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. + */ + +#ifndef WebFontInfo_h +#define WebFontInfo_h + +#include "../WebCString.h" +#include "../linux/WebFontRenderStyle.h" + +#include +#include + +namespace WebKit { + +class WebFontInfo { +public: + // Return a font family which provides glyphs for the Unicode code points + // specified by |utf16| + // characters: a native-endian UTF16 string + // numCharacters: the number of 16-bit words in |utf16| + // preferredLocale: preferred locale identifier for the |characters| + // (e.g. "en", "ja", "zh-CN") + // + // Returns: the font family or an empty string if the request could not be + // satisfied. + WEBKIT_EXPORT static WebCString familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale); + + // Fill out the given WebFontRenderStyle with the user's preferences for + // rendering the given font at the given size. + // family: i.e. "Times New Roman" + // sizeAndStyle: + // 3322222222221111111111 + // 10987654321098765432109876543210 + // +--------------------------------+ + // |..............Size............IB| + // +--------------------------------+ + // I: italic flag + // B: bold flag + WEBKIT_EXPORT static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); +}; + +} // namespace WebKit + +#endif -- 2.7.4