Title: [136749] trunk/Source
Revision
136749
Author
senorbla...@chromium.org
Date
2012-12-05 13:17:45 -0800 (Wed, 05 Dec 2012)

Log Message

Unreviewed, rolling out r136735.
http://trac.webkit.org/changeset/136735
https://bugs.webkit.org/show_bug.cgi?id=102699

Broke Chrome/Win build.

Source/WebCore:

* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/chromium/ScrollbarThemeChromiumWin.cpp:
(WebCore::ScrollbarThemeChromiumWin::paintTrackPiece):
(WebCore::ScrollbarThemeChromiumWin::paintButton):
(WebCore::ScrollbarThemeChromiumWin::paintThumb):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore):
(WebCore::RenderThemeChromiumWin::paintButton):
(WebCore::RenderThemeChromiumWin::paintSliderTrack):
(WebCore::RenderThemeChromiumWin::paintSliderThumb):
(WebCore::RenderThemeChromiumWin::paintMenuList):
(WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
(WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
(WebCore::RenderThemeChromiumWin::paintProgressBar):

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):
(WebCore::PlatformSupport::paintButton):
(WebCore::PlatformSupport::paintMenuList):
(WebCore::PlatformSupport::paintScrollbarArrow):
(WebCore::PlatformSupport::paintScrollbarThumb):
(WebCore::PlatformSupport::paintScrollbarTrack):
(WebCore::PlatformSupport::paintSpinButton):
(WebCore::PlatformSupport::paintTextField):
(WebCore::PlatformSupport::paintTrackbar):
(WebCore::PlatformSupport::paintProgressBar):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136748 => 136749)


--- trunk/Source/WebCore/ChangeLog	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebCore/ChangeLog	2012-12-05 21:17:45 UTC (rev 136749)
@@ -1,3 +1,27 @@
+2012-12-05  Stephen White  <senorbla...@chromium.org>
+
+        Unreviewed, rolling out r136735.
+        http://trac.webkit.org/changeset/136735
+        https://bugs.webkit.org/show_bug.cgi?id=102699
+
+        Broke Chrome/Win build.
+
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+        * platform/chromium/ScrollbarThemeChromiumWin.cpp:
+        (WebCore::ScrollbarThemeChromiumWin::paintTrackPiece):
+        (WebCore::ScrollbarThemeChromiumWin::paintButton):
+        (WebCore::ScrollbarThemeChromiumWin::paintThumb):
+        * rendering/RenderThemeChromiumWin.cpp:
+        (WebCore):
+        (WebCore::RenderThemeChromiumWin::paintButton):
+        (WebCore::RenderThemeChromiumWin::paintSliderTrack):
+        (WebCore::RenderThemeChromiumWin::paintSliderThumb):
+        (WebCore::RenderThemeChromiumWin::paintMenuList):
+        (WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
+        (WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
+        (WebCore::RenderThemeChromiumWin::paintProgressBar):
+
 2012-12-05  Jun Jiang  <jun.a.ji...@intel.com>
 
         WebGL: use pointer to the source data for Image directly in texImage2D and texSubImage2D to avoid memory copy if no conversion is needed

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (136748 => 136749)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-12-05 21:17:45 UTC (rev 136749)
@@ -78,6 +78,28 @@
 
     // Plugin -------------------------------------------------------------
     static bool plugins(bool refresh, Vector<PluginInfo>*);
+
+    // Theming ------------------------------------------------------------
+#if OS(WINDOWS) && !ENABLE(DEFAULT_RENDER_THEME)
+    static void paintButton(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&);
+    static void paintMenuList(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&);
+    static void paintScrollbarArrow(
+        GraphicsContext*, int state, int classicState, const IntRect&);
+    static void paintScrollbarThumb(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&);
+    static void paintScrollbarTrack(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&, const IntRect& alignRect);
+    static void paintSpinButton(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&);
+    static void paintTextField(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&, const Color&, bool fillContentArea, bool drawEdges);
+    static void paintTrackbar(
+        GraphicsContext*, int part, int state, int classicState, const IntRect&);
+    static void paintProgressBar(
+        GraphicsContext*, const IntRect& barRect, const IntRect& valueRect, bool determinate, double animatedSeconds);
+#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp (136748 => 136749)


--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp	2012-12-05 21:17:45 UTC (rev 136749)
@@ -34,11 +34,9 @@
 #include "LayoutTestSupport.h"
 #include "PlatformContextSkia.h"
 #include "PlatformMouseEvent.h"
+#include "PlatformSupport.h"
 #include "Scrollbar.h"
 #include "SystemInfo.h"
-#include <public/Platform.h>
-#include <public/WebRect.h>
-#include <public/win/WebThemeEngine.h>
 
 namespace WebCore {
 
@@ -106,10 +104,14 @@
 
     IntRect alignRect = trackRect(scrollbar, false);
 
-    WebKit::WebCanvas* canvas = gc->platformContext()->canvas();
     // Draw the track area before/after the thumb on the scroll bar.
-    WebKit::Platform::current()->themeEngine()->paintScrollbarTrack(canvas, partId, getThemeState(scrollbar, partType), getClassicThemeState(scrollbar, partType), WebKit::WebRect(rect), WebKit::WebRect(alignRect));
-
+    PlatformSupport::paintScrollbarTrack(
+        gc,
+        partId,
+        getThemeState(scrollbar, partType),
+        getClassicThemeState(scrollbar, partType),
+        rect,
+        alignRect);
 }
 
 void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
@@ -122,21 +124,33 @@
     else
         partId = horz ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN;
 
-    WebKit::WebCanvas* canvas = gc->platformContext()->canvas();
     // Draw the thumb (the box you drag in the scroll bar to scroll).
-    WebKit::Platform::current()->themeEngine()->paintScrollbarArrow(canvas, getThemeArrowState(scrollbar, part), partId | getClassicThemeState(scrollbar, part), WebKit::WebRect(rect);
+    PlatformSupport::paintScrollbarArrow(
+        gc,
+        getThemeArrowState(scrollbar, part),
+        partId | getClassicThemeState(scrollbar, part),
+        rect);
 }
 
 void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     bool horz = scrollbar->orientation() == HorizontalScrollbar;
 
-    WebKit::WebCanvas* canvas = gc->platformContext()->canvas();
     // Draw the thumb (the box you drag in the scroll bar to scroll).
-    WebKit::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), WebKit::WebRect(rect));
+    PlatformSupport::paintScrollbarThumb(
+        gc,
+        horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT,
+        getThemeState(scrollbar, ThumbPart),
+        getClassicThemeState(scrollbar, ThumbPart),
+        rect);
 
     // Draw the gripper (the three little lines on the thumb).
-    WebKit::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), WebKit::WebRect(rect));
+    PlatformSupport::paintScrollbarThumb(
+        gc,
+        horz ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT,
+        getThemeState(scrollbar, ThumbPart),
+        getClassicThemeState(scrollbar, ThumbPart),
+        rect);
 }
 
 int ScrollbarThemeChromiumWin::getThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumWin.cpp (136748 => 136749)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumWin.cpp	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumWin.cpp	2012-12-05 21:17:45 UTC (rev 136749)
@@ -38,7 +38,7 @@
 #include "LayoutTestSupport.h"
 #include "MediaControlElements.h"
 #include "PaintInfo.h"
-#include "PlatformContextSkia.h"
+#include "PlatformSupport.h"
 #include "RenderBox.h"
 #include "RenderProgress.h"
 #include "RenderSlider.h"
@@ -46,9 +46,6 @@
 #include "ScrollbarTheme.h"
 #include "SystemInfo.h"
 #include "TransparencyWin.h"
-#include <public/Platform.h>
-#include <public/WebRect.h>
-#include <public/win/WebThemeEngine.h>
 #include <wtf/CurrentTime.h>
 
 
@@ -307,8 +304,11 @@
     const ThemeData& themeData = getThemeData(o);
 
     ThemePainter painter(i.context, r);
-    WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-    WebKit::Platform::current()->themeEngine()->paintButton(canvas, themeData.m_part, themeData.m_state, themeData.m_classicState, WebKit::WebRect(painter.drawRect()));
+    PlatformSupport::paintButton(painter.context(),
+                                themeData.m_part,
+                                themeData.m_state,
+                                themeData.m_classicState,
+                                painter.drawRect());
     return false;
 }
 
@@ -322,8 +322,11 @@
     const ThemeData& themeData = getThemeData(o);
 
     ThemePainter painter(i.context, r);
-    WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-    WebKit::Platform::current()->themeEngine()->paintTrackbar(canvas, themeData.m_part, themeData.m_state, themeData.m_classicState, WebKit::WebRect(painter.drawRect()));
+    PlatformSupport::paintTrackbar(painter.context(),
+                                  themeData.m_part,
+                                  themeData.m_state,
+                                  themeData.m_classicState,
+                                  painter.drawRect());
 
 #if ENABLE(DATALIST_ELEMENT)
     paintSliderTicks(o, i, r);
@@ -337,8 +340,11 @@
     const ThemeData& themeData = getThemeData(o);
 
     ThemePainter painter(i.context, r);
-    WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-    WebKit::Platform::current()->themeEngine()->paintTrackbar(canvas, themeData.m_part, themeData.m_state, themeData.m_classicState, WebKit::WebRect(painter.drawRect()));
+    PlatformSupport::paintTrackbar(painter.context(),
+                                   themeData.m_part,
+                                   themeData.m_state,
+                                   themeData.m_classicState,
+                                   painter.drawRect());
 
     return false;
 }
@@ -393,8 +399,11 @@
 
     // Get the correct theme data for a textfield and paint the menu.
     ThemePainter painter(i.context, rect);
-    WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-    WebKit::Platform::current()->themeEngine()->paintMenuList(canvas, CP_DROPDOWNBUTTON, determineState(o), determineClassicState(o), WebKit::WebRect(painter.drawRect()));
+    PlatformSupport::paintMenuList(painter.context(),
+                                   CP_DROPDOWNBUTTON,
+                                   determineState(o),
+                                   determineClassicState(o),
+                                   painter.drawRect());
     return false;
 }
 
@@ -547,6 +556,7 @@
                                                     bool drawEdges)
 {
     // Fallback to white if the specified color object is invalid.
+    // (Note PlatformSupport::paintTextField duplicates this check).
     Color backgroundColor(Color::white);
     if (o->style()->visitedDependentColor(CSSPropertyBackgroundColor).isValid())
         backgroundColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor);
@@ -570,8 +580,14 @@
     {
         const ThemeData& themeData = getThemeData(o);
         ThemePainter painter(i.context, r);
-        WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-        WebKit::Platform::current()->themeEngine()->paintTextField(canvas, themeData.m_part, themeData.m_state, themeData.m_classicState, WebKit::WebRect(painter.drawRect()), backgroundColor, fillContentArea, drawEdges);
+        PlatformSupport::paintTextField(painter.context(),
+                                        themeData.m_part,
+                                        themeData.m_state,
+                                        themeData.m_classicState,
+                                        painter.drawRect(),
+                                        backgroundColor,
+                                        fillContentArea,
+                                        drawEdges);
         // End of block commits the painter before restoring context.
     }
     if (o->style()->hasBorderRadius())
@@ -595,16 +611,22 @@
         half.setHeight(rect.height() / 2);
         const ThemeData& upThemeData = getThemeData(object, SpinButtonUp);
         ThemePainter upPainter(info.context, half);
-        WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-        WebKit::Platform::current()->themeEngine()->paintSpinButton(canvas, upThemeData.m_part, upThemeData.m_state, upThemeData.m_classicState, WebKit::WebRect(upPainter.drawRect()));
+        PlatformSupport::paintSpinButton(upPainter.context(),
+                                         upThemeData.m_part,
+                                         upThemeData.m_state,
+                                         upThemeData.m_classicState,
+                                         upPainter.drawRect());
     }
 
     {
         half.setY(rect.y() + rect.height() / 2);
         const ThemeData& downThemeData = getThemeData(object, SpinButtonDown);
         ThemePainter downPainter(info.context, half);
-        WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-        WebKit::Platform::current()->themeEngine()->paintSpinButton(canvas, downThemeData.m_part, downThemeData.m_state, downThemeData.m_classicState, WebKit::WebRect(downPainter.drawRect()));
+        PlatformSupport::paintSpinButton(downPainter.context(),
+                                         downThemeData.m_part,
+                                         downThemeData.m_state,
+                                         downThemeData.m_classicState,
+                                         downPainter.drawRect());
     }
     return false;
 }
@@ -643,8 +665,7 @@
     double animatedSeconds = renderProgress->animationStartTime() ?  WTF::currentTime() - renderProgress->animationStartTime() : 0;
     ThemePainter painter(i.context, r);
     DirectionFlippingScope scope(o, i, r);
-    WebKit::WebCanvas* canvas = painter.context()->platformContext()->canvas();
-    WebKit::Platform::current()->themeEngine()->paintProgressBar(canvas, WebKit::WebRect(r), WebKit::WebRect(valueRect), renderProgress->isDeterminate(), animatedSeconds);
+    PlatformSupport::paintProgressBar(painter.context(), r, valueRect, renderProgress->isDeterminate(), animatedSeconds);
     return false;
 }
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (136748 => 136749)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-12-05 21:17:45 UTC (rev 136749)
@@ -1,5 +1,25 @@
 2012-12-05  Stephen White  <senorbla...@chromium.org>
 
+        Unreviewed, rolling out r136735.
+        http://trac.webkit.org/changeset/136735
+        https://bugs.webkit.org/show_bug.cgi?id=102699
+
+        Broke Chrome/Win build.
+
+        * src/PlatformSupport.cpp:
+        (WebCore):
+        (WebCore::PlatformSupport::paintButton):
+        (WebCore::PlatformSupport::paintMenuList):
+        (WebCore::PlatformSupport::paintScrollbarArrow):
+        (WebCore::PlatformSupport::paintScrollbarThumb):
+        (WebCore::PlatformSupport::paintScrollbarTrack):
+        (WebCore::PlatformSupport::paintSpinButton):
+        (WebCore::PlatformSupport::paintTextField):
+        (WebCore::PlatformSupport::paintTrackbar):
+        (WebCore::PlatformSupport::paintProgressBar):
+
+2012-12-05  Stephen White  <senorbla...@chromium.org>
+
         Unreviewed, rolling out r136741.
         http://trac.webkit.org/changeset/136741
         https://bugs.webkit.org/show_bug.cgi?id=104151

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (136748 => 136749)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-12-05 21:16:43 UTC (rev 136748)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-12-05 21:17:45 UTC (rev 136749)
@@ -56,10 +56,40 @@
 #include "platform/WebString.h"
 #include "platform/WebURL.h"
 
+#if OS(WINDOWS)
+#include "platform/WebRect.h"
+#if !ENABLE(DEFAULT_RENDER_THEME)
+#include <public/win/WebThemeEngine.h>
+#endif // !ENABLE(DEFAULT_RENDER_THEME)
+#endif
+
+#if ENABLE(DEFAULT_RENDER_THEME)
+#include <public/default/WebThemeEngine.h>
+#endif
+
+#if OS(DARWIN)
+#include <public/mac/WebThemeEngine.h>
+#elif OS(UNIX)
+#include "WebFontRenderStyle.h"
+#if OS(ANDROID)
+#include <public/android/WebThemeEngine.h>
+#else
+#include "WebFontInfo.h"
+#if !ENABLE(DEFAULT_RENDER_THEME)
+#include <public/linux/WebThemeEngine.h>
+#endif // !ENABLE(DEFAULT_RENDER_THEME)
+#endif // OS(ANDROID)
+#endif // elif OS(UNIX)
+
+#include "NativeImageSkia.h"
+
+#include "BitmapImage.h"
 #include "FrameView.h"
+#include "GraphicsContext.h"
 #include "IDBFactoryBackendProxy.h"
 #include "KURL.h"
 #include "NotImplemented.h"
+#include "PlatformContextSkia.h"
 #include "PluginData.h"
 #include "SharedBuffer.h"
 
@@ -92,6 +122,89 @@
     return true;  // FIXME: There is no need for this function to return a value.
 }
 
+// Theming --------------------------------------------------------------------
+
+#if OS(WINDOWS) && !ENABLE(DEFAULT_RENDER_THEME)
+
+void PlatformSupport::paintButton(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintButton(
+        gc->platformContext()->canvas(), part, state, classicState, rect);
+}
+
+void PlatformSupport::paintMenuList(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintMenuList(
+        gc->platformContext()->canvas(), part, state, classicState, rect);
+}
+
+void PlatformSupport::paintScrollbarArrow(
+    GraphicsContext* gc, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintScrollbarArrow(
+        gc->platformContext()->canvas(), state, classicState, rect);
+}
+
+void PlatformSupport::paintScrollbarThumb(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintScrollbarThumb(
+        gc->platformContext()->canvas(), part, state, classicState, rect);
+}
+
+void PlatformSupport::paintScrollbarTrack(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect, const IntRect& alignRect)
+{
+    WebKit::Platform::current()->themeEngine()->paintScrollbarTrack(
+        gc->platformContext()->canvas(), part, state, classicState, rect,
+        alignRect);
+}
+
+void PlatformSupport::paintSpinButton(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintSpinButton(
+        gc->platformContext()->canvas(), part, state, classicState, rect);
+}
+
+void PlatformSupport::paintTextField(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect, const Color& color, bool fillContentArea,
+    bool drawEdges)
+{
+    // Fallback to white when |color| is invalid.
+    RGBA32 backgroundColor = color.isValid() ? color.rgb() : Color::white;
+
+    WebKit::Platform::current()->themeEngine()->paintTextField(
+        gc->platformContext()->canvas(), part, state, classicState, rect,
+        backgroundColor, fillContentArea, drawEdges);
+}
+
+void PlatformSupport::paintTrackbar(
+    GraphicsContext* gc, int part, int state, int classicState,
+    const IntRect& rect)
+{
+    WebKit::Platform::current()->themeEngine()->paintTrackbar(
+        gc->platformContext()->canvas(), part, state, classicState, rect);
+}
+
+void PlatformSupport::paintProgressBar(
+    GraphicsContext* gc, const IntRect& barRect, const IntRect& valueRect, bool determinate, double animatedSeconds)
+{
+    WebKit::Platform::current()->themeEngine()->paintProgressBar(
+        gc->platformContext()->canvas(), barRect, valueRect, determinate, animatedSeconds);
+}
+
+#endif
+
 // These are temporary methods that the WebKit layer can use to call to the
 // Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
 // methods will be deleted.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to