Changeset 85643 in webkit
- Timestamp:
- May 3, 2011 1:07:20 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85642 r85643 1 2011-05-03 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [EFL] Implement mediaSliderTrack 6 https://bugs.webkit.org/show_bug.cgi?id=59998 7 8 Implement paintMediaSliderTrack. 9 10 * platform/efl/RenderThemeEfl.cpp: 11 (WebCore::RenderThemeEfl::RenderThemeEfl): 12 (WebCore::RenderThemeEfl::paintMediaSliderTrack): 13 * platform/efl/RenderThemeEfl.h: 14 1 15 2011-05-03 Mikhail Naganov <mnaganov@chromium.org> 2 16 -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp
r84348 r85643 50 50 #include "HTMLMediaElement.h" 51 51 #include "HTMLNames.h" 52 #include "TimeRanges.h" 52 53 #endif 53 54 … … 694 695 #if ENABLE(VIDEO) 695 696 , m_panelColor(220, 220, 195) // light tannish color. 697 , m_sliderColor(Color::white) 698 , m_mediaSliderHeight(14) 696 699 #endif 697 700 , m_canvas(0) … … 1164 1167 bool RenderThemeEfl::paintMediaSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect) 1165 1168 { 1169 GraphicsContext* context = info.context; 1170 1171 context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB); 1172 context->fillRect(FloatRect(IntRect(rect.x(), rect.y() + (rect.height() - m_mediaSliderHeight) / 2, 1173 rect.width(), m_mediaSliderHeight)), m_sliderColor, ColorSpaceDeviceRGB); 1174 1175 RenderStyle* style = object->style(); 1176 HTMLMediaElement* mediaElement = toParentMediaElement(object); 1177 1178 if (!mediaElement) 1179 return false; 1180 1181 // Draw the buffered ranges. This code is highly inspired from 1182 // Chrome for the gradient code. 1183 float mediaDuration = mediaElement->duration(); 1184 RefPtr<TimeRanges> timeRanges = mediaElement->buffered(); 1185 IntRect trackRect = rect; 1186 int totalWidth = trackRect.width(); 1187 1188 trackRect.inflate(-style->borderLeftWidth()); 1189 context->save(); 1190 context->setStrokeStyle(NoStroke); 1191 1192 for (unsigned index = 0; index < timeRanges->length(); ++index) { 1193 ExceptionCode ignoredException; 1194 float start = timeRanges->start(index, ignoredException); 1195 float end = timeRanges->end(index, ignoredException); 1196 int width = ((end - start) * totalWidth) / mediaDuration; 1197 IntRect rangeRect; 1198 if (!index) { 1199 rangeRect = trackRect; 1200 rangeRect.setWidth(width); 1201 } else { 1202 rangeRect.setLocation(IntPoint(trackRect.x() + start / mediaDuration* totalWidth, trackRect.y())); 1203 rangeRect.setSize(IntSize(width, trackRect.height())); 1204 } 1205 1206 // Don't bother drawing empty range. 1207 if (rangeRect.isEmpty()) 1208 continue; 1209 1210 IntPoint sliderTopLeft = rangeRect.location(); 1211 IntPoint sliderTopRight = sliderTopLeft; 1212 sliderTopRight.move(0, rangeRect.height()); 1213 1214 context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB); 1215 } 1216 context->restore(); 1217 return true; 1218 } 1219 1220 bool RenderThemeEfl::paintMediaSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect) 1221 { 1166 1222 notImplemented(); 1167 1223 return false; 1168 1224 } 1169 1225 1170 bool RenderThemeEfl::paintMedia SliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)1226 bool RenderThemeEfl::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo& info, const IntRect& rect) 1171 1227 { 1172 1228 notImplemented(); … … 1174 1230 } 1175 1231 1176 bool RenderThemeEfl::paintMediaVolumeSlider Container(RenderObject*, const PaintInfo& info, const IntRect& rect)1232 bool RenderThemeEfl::paintMediaVolumeSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect) 1177 1233 { 1178 1234 notImplemented(); … … 1180 1236 } 1181 1237 1182 bool RenderThemeEfl::paintMediaVolumeSliderT rack(RenderObject* object, const PaintInfo& info, const IntRect& rect)1238 bool RenderThemeEfl::paintMediaVolumeSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect) 1183 1239 { 1184 1240 notImplemented(); … … 1186 1242 } 1187 1243 1188 bool RenderThemeEfl::paintMediaVolumeSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)1189 {1190 notImplemented();1191 return false;1192 }1193 1194 1244 bool RenderThemeEfl::paintMediaCurrentTime(RenderObject* object, const PaintInfo& info, const IntRect& rect) 1195 1245 { -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.h
r84348 r85643 212 212 #if ENABLE(VIDEO) 213 213 Color m_panelColor; 214 Color m_sliderColor; 215 const int m_mediaSliderHeight; 214 216 #endif 215 217 Ecore_Evas* m_canvas;
Note: See TracChangeset
for help on using the changeset viewer.