Changeset 133632 in webkit
- Timestamp:
- Nov 6, 2012 10:17:36 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r133631 r133632 1 2012-11-06 Tiancheng Jiang <tijiang@rim.com> 2 3 [BlackBerry] Update BB10 form theme. 4 https://bugs.webkit.org/show_bug.cgi?id=100760 5 6 Reviewed by Rob Buis. 7 8 Revert webkit/ce306dcc698199a6f7ce679daf0a30c25d3a3d43 slider theme 9 change which break media control and vertical slider. 10 11 RIM PR 236993 12 Internal Reviewed by Jeff Rogers. 13 14 * platform/blackberry/RenderThemeBlackBerry.cpp: 15 (WebCore::RenderThemeBlackBerry::paintSliderTrackRect): 16 (WebCore::RenderThemeBlackBerry::paintSliderThumb): 17 1 18 2012-11-06 Michael Saboff <msaboff@apple.com> 2 19 -
trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
r133186 r133632 175 175 FloatRect srcRect(0, 0, img->width(), img->height()); 176 176 gc->drawImage(img, ColorSpaceDeviceRGB, rect, srcRect); 177 }178 179 static void drawThreeSlice(GraphicsContext* gc, const IntRect& rect, Image* img, int slice)180 {181 if (!img)182 return;183 FloatSize dstSlice(rect.height() / 2, rect.height());184 FloatRect srcRect(0, 0, slice, img->height());185 FloatRect dstRect(rect.location(), dstSlice);186 187 gc->drawImage(img, ColorSpaceDeviceRGB, dstRect, srcRect);188 srcRect.move(img->width() - srcRect.width(), 0);189 dstRect.move(rect.width() - dstRect.width(), 0);190 gc->drawImage(img, ColorSpaceDeviceRGB, dstRect, srcRect);191 192 srcRect = FloatRect(slice, 0, img->width() - 2 * slice, img->height());193 dstRect = FloatRect(rect.x() + dstSlice.width(), rect.y(), rect.width() - 2 * dstSlice.width(), dstSlice.height());194 gc->drawImage(img, ColorSpaceDeviceRGB, dstRect, srcRect);195 177 } 196 178 … … 723 705 RGBA32 strokeColorStart, RGBA32 strokeColorEnd, RGBA32 fillColorStart, RGBA32 fillColorEnd) 724 706 { 725 ASSERT(info.context); 707 FloatSize smallCorner(smallRadius, smallRadius); 708 726 709 info.context->save(); 727 GraphicsContext* context = info.context; 728 729 static RefPtr<Image> disabled, inactive; 730 if (!disabled) { 731 disabled = loadImage("core_slider_fill_disabled"); 732 inactive = loadImage("core_slider_bg"); 733 } 734 735 if (isEnabled(object)) 736 drawThreeSlice(context, rect, inactive.get(), mediumSlice); 737 else 738 drawThreeSlice(context, rect, disabled.get(), (smallSlice - 1)); 739 740 context->restore(); 710 info.context->setStrokeStyle(SolidStroke); 711 info.context->setStrokeThickness(lineWidth); 712 713 info.context->setStrokeGradient(createLinearGradient(strokeColorStart, strokeColorEnd, rect.maxXMinYCorner(), rect. maxXMaxYCorner())); 714 info.context->setFillGradient(createLinearGradient(fillColorStart, fillColorEnd, rect.maxXMinYCorner(), rect.maxXMaxYCorner())); 715 716 Path path; 717 path.addRoundedRect(rect, smallCorner); 718 info.context->fillPath(path); 719 720 info.context->restore(); 741 721 return false; 742 722 } … … 744 724 bool RenderThemeBlackBerry::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect) 745 725 { 746 ASSERT(info.context);726 FloatSize largeCorner(largeRadius, largeRadius); 747 727 info.context->save(); 748 GraphicsContext* context = info.context; 749 750 static RefPtr<Image> disabled, inactive, pressed, aura; 751 if (!disabled) { 752 disabled = loadImage("core_slider_handle_disabled"); 753 inactive = loadImage("core_slider_handle"); 754 pressed = loadImage("core_slider_handle_pressed"); 755 aura = loadImage("core_slider_aura"); 756 } 757 758 FloatRect tmpRect(rect); 759 float length = std::max(tmpRect.width(), tmpRect.height()); 760 if (tmpRect.width() > tmpRect.height()) { 761 tmpRect.setY(tmpRect.y() - (length - tmpRect.height()) / 2); 762 tmpRect.setHeight(length); 728 info.context->setStrokeStyle(SolidStroke); 729 info.context->setStrokeThickness(lineWidth); 730 if (isPressed(object) || isHovered(object)) { 731 info.context->setStrokeGradient(createLinearGradient(hoverTopOutline, hoverBottomOutline, rect.maxXMinYCorner(), rect. maxXMaxYCorner())); 732 info.context->setFillGradient(createLinearGradient(hoverTop, hoverBottom, rect.maxXMinYCorner(), rect.maxXMaxYCorner())); 763 733 } else { 764 tmpRect.setX(tmpRect.x() - (length - tmpRect.width()) / 2); 765 tmpRect.setWidth(length); 766 } 767 768 float auraHeight = length * auraRatio; 769 float auraWidth = auraHeight; 770 float auraX = tmpRect.x() - (auraWidth - tmpRect.width()) / 2; 771 float auraY = tmpRect.y() - (auraHeight - tmpRect.height()) / 2; 772 FloatRect auraRect(auraX, auraY, auraWidth, auraHeight); 773 774 if (!isEnabled(object)) 775 drawControl(context, tmpRect, disabled.get()); 776 else { 777 if (isPressed(object) || isHovered(object) || isFocused(object)) { 778 drawControl(context, tmpRect, pressed.get()); 779 drawControl(context, auraRect, aura.get()); 734 info.context->setStrokeGradient(createLinearGradient(regularTopOutline, regularBottomOutline, rect.maxXMinYCorner(), rect. maxXMaxYCorner())); 735 info.context->setFillGradient(createLinearGradient(regularTop, regularBottom, rect.maxXMinYCorner(), rect.maxXMaxYCorner())); 736 } 737 Path path; 738 path.addRoundedRect(rect, largeCorner); 739 info.context->fillPath(path); 740 bool isVertical = rect.width() > rect.height(); 741 IntPoint startPoint(rect.x() + (isVertical ? 5 : 2), rect.y() + (isVertical ? 2 : 5)); 742 IntPoint endPoint(rect.x() + (isVertical ? 20 : 2), rect.y() + (isVertical ? 2 : 20)); 743 const int lineOffset = 2; 744 const int shadowOffset = 1; 745 for (int i = 0; i < 3; i++) { 746 if (isVertical) { 747 startPoint.setY(startPoint.y() + lineOffset); 748 endPoint.setY(endPoint.y() + lineOffset); 780 749 } else { 781 drawControl(context, tmpRect, inactive.get()); 750 startPoint.setX(startPoint.x() + lineOffset); 751 endPoint.setX(endPoint.x() + lineOffset); 782 752 } 783 } 784 785 context->restore(); 753 if (isPressed(object) || isHovered(object)) 754 info.context->setStrokeColor(dragRollLight, ColorSpaceDeviceRGB); 755 else 756 info.context->setStrokeColor(dragRegularLight, ColorSpaceDeviceRGB); 757 info.context->drawLine(startPoint, endPoint); 758 if (isVertical) { 759 startPoint.setY(startPoint.y() + shadowOffset); 760 endPoint.setY(endPoint.y() + shadowOffset); 761 } else { 762 startPoint.setX(startPoint.x() + shadowOffset); 763 endPoint.setX(endPoint.x() + shadowOffset); 764 } 765 if (isPressed(object) || isHovered(object)) 766 info.context->setStrokeColor(dragRollDark, ColorSpaceDeviceRGB); 767 else 768 info.context->setStrokeColor(dragRegularDark, ColorSpaceDeviceRGB); 769 info.context->drawLine(startPoint, endPoint); 770 } 771 info.context->restore(); 786 772 return false; 787 773 }
Note: See TracChangeset
for help on using the changeset viewer.