Skip to content
Permalink
Browse files
[BlackBerry] Update BB10 form theme.
https://bugs.webkit.org/show_bug.cgi?id=100760

Patch by Tiancheng Jiang <tijiang@rim.com> on 2012-11-01
Reviewed by Rob Buis.

RIM PR 235194.

Check img pointer is null, if so, do early return.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::drawControl):
(WebCore::drawThreeSlice):
(WebCore::drawNineSlice):

Canonical link: https://commits.webkit.org/119053@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Tiancheng Jiang authored and webkit-commit-queue committed Nov 1, 2012
1 parent 9618871 commit c0071f28286ea54e0bdeb5744016e5acef3e1a43
Showing 2 changed files with 22 additions and 0 deletions.
@@ -1,3 +1,19 @@
2012-11-01 Tiancheng Jiang <tijiang@rim.com>

[BlackBerry] Update BB10 form theme.
https://bugs.webkit.org/show_bug.cgi?id=100760

Reviewed by Rob Buis.

RIM PR 235194.

Check img pointer is null, if so, do early return.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::drawControl):
(WebCore::drawThreeSlice):
(WebCore::drawNineSlice):

2012-11-01 Adam Barth <abarth@webkit.org>

Unreviewed. Build fix.
@@ -170,12 +170,16 @@ static float determineFullScreenMultiplier(Element* element)

static void drawControl(GraphicsContext* gc, const FloatRect& rect, Image* img)
{
if (!img)
return;
FloatRect srcRect(0, 0, img->width(), img->height());
gc->drawImage(img, ColorSpaceDeviceRGB, rect, srcRect);
}

static void drawThreeSlice(GraphicsContext* gc, const IntRect& rect, Image* img, int slice)
{
if (!img)
return;
FloatSize dstSlice(rect.height() / 2, rect.height());
FloatRect srcRect(0, 0, slice, img->height());
FloatRect dstRect(rect.location(), dstSlice);
@@ -192,6 +196,8 @@ static void drawThreeSlice(GraphicsContext* gc, const IntRect& rect, Image* img,

static void drawNineSlice(GraphicsContext* gc, const IntRect& rect, double scale, Image* img, int slice)
{
if (!img)
return;
if (rect.height() * scale < 101.0)
scale = 101.0 / rect.height();
FloatSize dstSlice(slice / scale, slice / scale);

0 comments on commit c0071f2

Please sign in to comment.