Changeset 88753 in webkit


Ignore:
Timestamp:
Jun 13, 2011 7:19:43 PM (13 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

2011-06-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>

Reviewed by Kent Tamura.

[EFL] Support for painting thumb of media slider
https://bugs.webkit.org/show_bug.cgi?id=62174

Implement paintMediaSliderThumb() function to show thumb of media slider.
adjustSliderThumbSize() should be implemented in order to call paintMediaSliderThumb().

  • platform/efl/RenderThemeEfl.cpp: (WebCore::RenderThemeEfl::RenderThemeEfl): (WebCore::RenderThemeEfl::adjustSliderThumbSize): (WebCore::RenderThemeEfl::paintMediaSliderTrack): (WebCore::RenderThemeEfl::paintMediaSliderThumb): (WebCore::RenderThemeEfl::paintMediaCurrentTime):
  • platform/efl/RenderThemeEfl.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88751 r88753  
     12011-06-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Reviewed by Kent Tamura.
     4
     5        [EFL] Support for painting thumb of media slider
     6        https://bugs.webkit.org/show_bug.cgi?id=62174
     7
     8        Implement paintMediaSliderThumb() function to show thumb of media slider.
     9        adjustSliderThumbSize() should be implemented in order to call paintMediaSliderThumb().
     10
     11        * platform/efl/RenderThemeEfl.cpp:
     12        (WebCore::RenderThemeEfl::RenderThemeEfl):
     13        (WebCore::RenderThemeEfl::adjustSliderThumbSize):
     14        (WebCore::RenderThemeEfl::paintMediaSliderTrack):
     15        (WebCore::RenderThemeEfl::paintMediaSliderThumb):
     16        (WebCore::RenderThemeEfl::paintMediaCurrentTime):
     17        * platform/efl/RenderThemeEfl.h:
     18
    1192011-06-13  Keishi Hattori  <keishi@webkit.org>
    220
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp

    r88405 r88753  
    6161// TODO: as objects are webpage/user defined and they can be very large.
    6262#define RENDER_THEME_EFL_PART_CACHE_MAX 32
     63   
     64static const int sliderThumbWidth = 12;
     65static const int sliderThumbHeight = 12;
     66
     67#if ENABLE(VIDEO)
     68static const int mediaSliderHeight = 14;
     69static const int mediaSliderThumbWidth = 12;
     70static const int mediaSliderThumbHeight = 12;
     71#endif
    6372
    6473void RenderThemeEfl::adjustSizeConstraints(RenderStyle* style, FormType type) const
     
    693702    , m_searchTextBackgroundColor(0, 0, 0, 0)
    694703    , m_searchTextForegroundColor(0, 0, 0)
     704    , m_sliderThumbColor(255, 0, 0) // red color.
    695705#if ENABLE(VIDEO)
    696     , m_panelColor(220, 220, 195) // light tannish color.
    697     , m_sliderColor(Color::white)
    698     , m_mediaSliderHeight(14)
     706    , m_mediaPanelColor(220, 220, 195) // light tannish color.
     707    , m_mediaSliderColor(Color::white)
    699708#endif
    700709    , m_canvas(0)
     
    839848}
    840849
     850void RenderThemeEfl::adjustSliderThumbSize(RenderObject* o) const
     851{
     852    ControlPart part = o->style()->appearance();
     853    if (part == SliderThumbVerticalPart || part == SliderThumbHorizontalPart) {
     854        o->style()->setWidth(Length(sliderThumbHeight, Fixed));
     855        o->style()->setHeight(Length(sliderThumbWidth, Fixed));
     856    }
     857#if ENABLE(VIDEO)
     858    else if (part == MediaSliderThumbPart) {
     859        o->style()->setWidth(Length(mediaSliderThumbWidth, Fixed));
     860        o->style()->setHeight(Length(mediaSliderThumbHeight, Fixed));
     861    }
     862#endif
     863}
     864
    841865bool RenderThemeEfl::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    842866{
     
    11801204    GraphicsContext* context = info.context;
    11811205
    1182     context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB);
    1183     context->fillRect(FloatRect(IntRect(rect.x(), rect.y() + (rect.height() - m_mediaSliderHeight) / 2,
    1184                                         rect.width(), m_mediaSliderHeight)), m_sliderColor, ColorSpaceDeviceRGB);
     1206    context->fillRect(FloatRect(rect), m_mediaPanelColor, ColorSpaceDeviceRGB);
     1207    context->fillRect(FloatRect(IntRect(rect.x(), rect.y() + (rect.height() - mediaSliderHeight) / 2,
     1208                                        rect.width(), mediaSliderHeight)), m_mediaSliderColor, ColorSpaceDeviceRGB);
    11851209
    11861210    RenderStyle* style = object->style();
     
    12231247        sliderTopRight.move(0, rangeRect.height());
    12241248
    1225         context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB);
     1249        context->fillRect(FloatRect(rect), m_mediaPanelColor, ColorSpaceDeviceRGB);
    12261250    }
    12271251    context->restore();
     
    12311255bool RenderThemeEfl::paintMediaSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    12321256{
     1257    info.context->fillRoundedRect(rect, IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), m_sliderThumbColor, ColorSpaceDeviceRGB);
     1258    return true;
     1259}
     1260
     1261bool RenderThemeEfl::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo& info, const IntRect& rect)
     1262{
    12331263    notImplemented();
    12341264    return false;
    12351265}
    12361266
    1237 bool RenderThemeEfl::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo& info, const IntRect& rect)
     1267bool RenderThemeEfl::paintMediaVolumeSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    12381268{
    12391269    notImplemented();
     
    12411271}
    12421272
    1243 bool RenderThemeEfl::paintMediaVolumeSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     1273bool RenderThemeEfl::paintMediaVolumeSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    12441274{
    12451275    notImplemented();
     
    12471277}
    12481278
    1249 bool RenderThemeEfl::paintMediaVolumeSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    1250 {
    1251     notImplemented();
    1252     return false;
    1253 }
    1254 
    12551279bool RenderThemeEfl::paintMediaCurrentTime(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    12561280{
    1257     info.context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB);
     1281    info.context->fillRect(FloatRect(rect), m_mediaPanelColor, ColorSpaceDeviceRGB);
    12581282    return true;
    12591283}
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.h

    r88333 r88753  
    157157
    158158    virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     159
     160    virtual void adjustSliderThumbSize(RenderObject*) const;
     161
    159162    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    160163
     
    213216    Color m_searchTextBackgroundColor;
    214217    Color m_searchTextForegroundColor;
    215 #if ENABLE(VIDEO)
    216     Color m_panelColor;
    217     Color m_sliderColor;
    218     const int m_mediaSliderHeight;
     218    Color m_sliderThumbColor;
     219
     220#if ENABLE(VIDEO)
     221    Color m_mediaPanelColor;
     222    Color m_mediaSliderColor;
    219223#endif
    220224    Ecore_Evas* m_canvas;
Note: See TracChangeset for help on using the changeset viewer.