Commit 51cda553 authored by mihaip@chromium.org's avatar mihaip@chromium.org

2011-01-07 Mihai Parparita <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] Scrollbar code cleanup
        https://bugs.webkit.org/show_bug.cgi?id=52073

        Scrollbar code cleanup:
        - Remove ScrollbarThemeMac.{mm|h} from the mac sources list, we use
          ScrollbarThemeChromiumMac.{mm|h}
        - Remove USE_WEB_THEME_ENGINE_TO_PAINT_THUMB #define now that switch to
          WebThemeEngine is permanent
        - Fix typo in Linux scrollbar enum name

        No new tests (compiles).

        * WebCore.gypi:
        * platform/chromium/ChromiumBridge.h:
        * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
        (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
        * platform/chromium/ScrollbarThemeChromiumMac.mm:
        (WebCore::scrollbarStateToThemeState):
        (WebCore::ScrollbarThemeChromiumMac::paint):
2011-01-07  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] Scrollbar code cleanup
        https://bugs.webkit.org/show_bug.cgi?id=52073

        Scrollbar code cleanup:
        - Fix typo in Linux scrollbar enum name

        * public/linux/WebThemeEngine.h:
        * src/ChromiumBridge.cpp:
        (WebCore::WebThemePart):
        (WebCore::GetWebThemeExtraParams):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9dadbf4a
2011-01-07 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] Scrollbar code cleanup
https://bugs.webkit.org/show_bug.cgi?id=52073
Scrollbar code cleanup:
- Remove ScrollbarThemeMac.{mm|h} from the mac sources list, we use
ScrollbarThemeChromiumMac.{mm|h}
- Remove USE_WEB_THEME_ENGINE_TO_PAINT_THUMB #define now that switch to
WebThemeEngine is permanent
- Fix typo in Linux scrollbar enum name
No new tests (compiles).
* WebCore.gypi:
* platform/chromium/ChromiumBridge.h:
* platform/chromium/ScrollbarThemeChromiumLinux.cpp:
(WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::scrollbarStateToThemeState):
(WebCore::ScrollbarThemeChromiumMac::paint):
2011-01-07 Jer Noble <jer.noble@apple.com>
GTK Linux build fix: isDocumentRunningFullScreenAnimation should
......
......@@ -3081,8 +3081,6 @@
'platform/mac/SSLKeyGeneratorMac.mm',
'platform/mac/SchedulePairMac.mm',
'platform/mac/ScrollViewMac.mm',
'platform/mac/ScrollbarThemeMac.h',
'platform/mac/ScrollbarThemeMac.mm',
'platform/mac/SearchPopupMenuMac.h',
'platform/mac/SearchPopupMenuMac.mm',
'platform/mac/SharedBufferMac.mm',
......
......@@ -277,7 +277,7 @@ namespace WebCore {
PartScrollbarUpArrow,
PartScrollbarHorizontalThumb,
PartScrollbarVerticalThumb,
PartScrollbarHoriztonalTrack,
PartScrollbarHorizontalTrack,
PartScrollbarVerticalTrack,
};
......
......@@ -61,7 +61,7 @@ void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar
extraParams.scrollbarTrack.trackHeight = alignRect.height();
ChromiumBridge::paintThemePart(
gc,
scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::PartScrollbarHoriztonalTrack : ChromiumBridge::PartScrollbarVerticalTrack,
scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::PartScrollbarHorizontalTrack : ChromiumBridge::PartScrollbarVerticalTrack,
state,
rect,
&extraParams);
......
......@@ -27,13 +27,8 @@
#include "config.h"
#include "ScrollbarThemeChromiumMac.h"
// FIXME: Remove this (always use WebThemeEngine) once we rebaseline tests
#define USE_WEB_THEME_ENGINE_TO_PAINT_THUMB 1
#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
#include "ChromiumBridge.h"
#include "FrameView.h"
#endif
#include "ImageBuffer.h"
#include "PlatformMouseEvent.h"
#include "ScrollView.h"
......@@ -54,6 +49,7 @@ using namespace WebCore;
// The only changes from ScrollbarThemeMac should be:
// - The classname change from ScrollbarThemeMac to ScrollbarThemeChromiumMac.
// - In paint() the code to paint the track, tickmarks, and thumb separately.
// - In paint() the thumb is drawn via ChromeBridge/WebThemeEngine.
//
// For all other differences, if it was introduced in this file, then the
// maintainer forgot to include it in the list; otherwise it is an update that
......@@ -374,7 +370,6 @@ static int scrollbarPartToHIPressedState(ScrollbarPart part)
}
}
#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
static ChromiumBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar) {
if (!scrollbar->enabled())
return ChromiumBridge::StateDisabled;
......@@ -385,7 +380,6 @@ static ChromiumBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scr
return ChromiumBridge::StateActive;
}
#endif // USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
{
......@@ -469,7 +463,6 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
}
if (hasThumb(scrollbar)) {
#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
ChromiumBridge::ThemePaintScrollbarInfo scrollbarInfo;
scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::ScrollbarOrientationHorizontal : ChromiumBridge::ScrollbarOrientationVertical;
scrollbarInfo.parent = scrollbar->parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? ChromiumBridge::ScrollbarParentScrollView : ChromiumBridge::ScrollbarParentRenderLayer;
......@@ -484,10 +477,6 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
scrollbar->controlSize() == RegularScrollbar ? ChromiumBridge::SizeRegular : ChromiumBridge::SizeSmall,
scrollbar->frameRect(),
scrollbarInfo);
#else
trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
HIThemeDrawTrack(&trackInfo, 0, drawingContext->platformContext(), kHIThemeOrientationNormal);
#endif
}
if (!canDrawDirectly)
......
2011-01-07 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] Scrollbar code cleanup
https://bugs.webkit.org/show_bug.cgi?id=52073
Scrollbar code cleanup:
- Fix typo in Linux scrollbar enum name
* public/linux/WebThemeEngine.h:
* src/ChromiumBridge.cpp:
(WebCore::WebThemePart):
(WebCore::GetWebThemeExtraParams):
2011-01-07 James Robinson <jamesr@chromium.org>
Revert "Implement mozilla's animationTime property"
......@@ -39,6 +39,9 @@ namespace WebKit {
struct WebRect;
// FIXME: Remove once webkit/glue/webthemeengine_impl_linux.c has been updated to use the correct spelling.
#define PartScrollbarHoriztonalTrack PartScrollbarHorizontalTrack
class WebThemeEngine {
public:
// The UI part which is being accessed.
......@@ -49,7 +52,7 @@ public:
PartScrollbarUpArrow,
PartScrollbarHorizontalThumb,
PartScrollbarVerticalThumb,
PartScrollbarHoriztonalTrack,
PartScrollbarHorizontalTrack,
PartScrollbarVerticalTrack
};
......@@ -61,7 +64,7 @@ public:
StatePressed,
};
// Extra parameters for drawing the PartScrollbarHoriztonalTrack and
// Extra parameters for drawing the PartScrollbarHorizontalTrack and
// PartScrollbarVerticalTrack.
struct ScrollbarTrackExtraParams {
// The bounds of the entire track, as opposed to the part being painted.
......
......@@ -803,7 +803,7 @@ static WebThemeEngine::Part WebThemePart(ChromiumBridge::ThemePart part)
case ChromiumBridge::PartScrollbarUpArrow: return WebThemeEngine::PartScrollbarUpArrow;
case ChromiumBridge::PartScrollbarHorizontalThumb: return WebThemeEngine::PartScrollbarHorizontalThumb;
case ChromiumBridge::PartScrollbarVerticalThumb: return WebThemeEngine::PartScrollbarVerticalThumb;
case ChromiumBridge::PartScrollbarHoriztonalTrack: return WebThemeEngine::PartScrollbarHoriztonalTrack;
case ChromiumBridge::PartScrollbarHorizontalTrack: return WebThemeEngine::PartScrollbarHorizontalTrack;
case ChromiumBridge::PartScrollbarVerticalTrack: return WebThemeEngine::PartScrollbarVerticalTrack;
}
ASSERT_NOT_REACHED();
......@@ -824,7 +824,7 @@ static WebThemeEngine::State WebThemeState(ChromiumBridge::ThemePaintState state
static void GetWebThemeExtraParams(ChromiumBridge::ThemePart part, ChromiumBridge::ThemePaintState state, const ChromiumBridge::ThemePaintExtraParams* extraParams, WebThemeEngine::ExtraParams* webThemeExtraParams)
{
if (part == ChromiumBridge::PartScrollbarHoriztonalTrack || part == ChromiumBridge::PartScrollbarVerticalTrack) {
if (part == ChromiumBridge::PartScrollbarHorizontalTrack || part == ChromiumBridge::PartScrollbarVerticalTrack) {
webThemeExtraParams->scrollbarTrack.trackX = extraParams->scrollbarTrack.trackX;
webThemeExtraParams->scrollbarTrack.trackY = extraParams->scrollbarTrack.trackY;
webThemeExtraParams->scrollbarTrack.trackWidth = extraParams->scrollbarTrack.trackWidth;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment