WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 79212
[BlackBerry] Upstream ImageBlackBerry in platform/graphics/blackberry
https://bugs.webkit.org/show_bug.cgi?id=79212
Summary
[BlackBerry] Upstream ImageBlackBerry in platform/graphics/blackberry
Robin Cao
Reported
2012-02-22 02:15:39 PST
Add ImageBlackBerry.cpp in platform/graphics/blackberry.
Attachments
patch
(4.69 KB, patch)
2012-02-22 02:28 PST
,
Robin Cao
no flags
Details
Formatted Diff
Diff
updated patch
(4.58 KB, patch)
2012-02-22 20:00 PST
,
Robin Cao
no flags
Details
Formatted Diff
Diff
Updated patch for landing
(4.60 KB, patch)
2012-02-23 21:48 PST
,
Robin Cao
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Robin Cao
Comment 1
2012-02-22 02:28:26 PST
Created
attachment 128163
[details]
patch
Rob Buis
Comment 2
2012-02-22 04:25:05 PST
Comment on
attachment 128163
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128163&action=review
Still some stuff to improve.
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:2 > + * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
Needs 2012.
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:30 > + String iconName(name); // a.k.a. "enable string comparisons with =="
I dont see a need for this, why not just use strcmp?
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:40 > + context->fillRect(FloatRect(0, 0, 16, 16), Color::white, ColorSpaceDeviceRGB);
There may be a variant that flood fills the entire surface, then you dont need to specify the FloatRect.
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:59 > + // FIXME: Have a setting for the resource path
Is the FIXME still accurate?
Robin Cao
Comment 3
2012-02-22 19:48:18 PST
(In reply to
comment #2
)
> (From update of
attachment 128163
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=128163&action=review
> > Still some stuff to improve. > > > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:2 > > + * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. > > Needs 2012.
Will add.
> > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:30 > > + String iconName(name); // a.k.a. "enable string comparisons with ==" > > I dont see a need for this, why not just use strcmp? >
Good point.
> > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:40 > > + context->fillRect(FloatRect(0, 0, 16, 16), Color::white, ColorSpaceDeviceRGB); > > There may be a variant that flood fills the entire surface, then you dont need to specify the FloatRect. >
GraphicsContext does not have functions that flood fills the entire surface, though SkCanvas have such functions. We can change it something like this: SkCanvas* canvas = context->platformContext()->canvas(); canvas->drawColor(SK_ColorWHITE); Both are ok for me, but I prefer not to change it.
> > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:59 > > + // FIXME: Have a setting for the resource path > > Is the FIXME still accurate?
I don't think we need to add a public setting for the resource path. And seems no other ports did this. I will remove the FIXME.
Robin Cao
Comment 4
2012-02-22 20:00:46 PST
Created
attachment 128375
[details]
updated patch
Antonio Gomes
Comment 5
2012-02-23 19:27:10 PST
Comment on
attachment 128375
[details]
updated patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128375&action=review
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:52 > + context->fillRect(FloatRect(0, 0, 16, 16), Color::white, ColorSpaceDeviceRGB); > + > + if (!strcmp(name, "searchCancel")) > + context->setFillColor(Color(128, 128, 128), ColorSpaceDeviceRGB); > + else > + context->setFillColor(Color(64, 64, 64), ColorSpaceDeviceRGB); > + > + context->translate(8, 8); > + > + context->rotate(piDouble / 4.0); > + context->fillRect(FloatRect(-1, -7, 2, 14)); > + > + context->rotate(-piDouble / 2.0); > + context->fillRect(FloatRect(-1, -7, 2, 14));
some magic numbers here. Anyway we could improve it?
> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:70 > + img->setData(buffer.release(), true);
what is true here?
Robin Cao
Comment 6
2012-02-23 20:16:21 PST
(In reply to
comment #5
)
> (From update of
attachment 128375
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=128375&action=review
> > > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:52 > > + context->fillRect(FloatRect(0, 0, 16, 16), Color::white, ColorSpaceDeviceRGB); > > + > > + if (!strcmp(name, "searchCancel")) > > + context->setFillColor(Color(128, 128, 128), ColorSpaceDeviceRGB); > > + else > > + context->setFillColor(Color(64, 64, 64), ColorSpaceDeviceRGB); > > + > > + context->translate(8, 8); > > + > > + context->rotate(piDouble / 4.0); > > + context->fillRect(FloatRect(-1, -7, 2, 14)); > > + > > + context->rotate(-piDouble / 2.0); > > + context->fillRect(FloatRect(-1, -7, 2, 14)); > > some magic numbers here. Anyway we could improve it? >
We just want to draw a "x" here. Maybe i should add a comment?
> > Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:70 > > + img->setData(buffer.release(), true); > > what is true here?
true == allDataReceived bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
Antonio Gomes
Comment 7
2012-02-23 20:21:55 PST
Comment on
attachment 128375
[details]
updated patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128375&action=review
>>> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:52 >>> + context->fillRect(FloatRect(-1, -7, 2, 14)); >> >> some magic numbers here. Anyway we could improve it? > > We just want to draw a "x" here. Maybe i should add a comment?
please add.
>>> Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp:70 >>> + img->setData(buffer.release(), true); >> >> what is true here? > > true == allDataReceived > bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
lets add a /*allDataReceived*/ comment
Robin Cao
Comment 8
2012-02-23 21:48:40 PST
Created
attachment 128647
[details]
Updated patch for landing
Leo Yang
Comment 9
2012-02-23 21:55:18 PST
Comment on
attachment 128647
[details]
Updated patch for landing Sending to cq...
WebKit Review Bot
Comment 10
2012-02-24 04:38:47 PST
Comment on
attachment 128647
[details]
Updated patch for landing Clearing flags on attachment: 128647 Committed
r108774
: <
http://trac.webkit.org/changeset/108774
>
WebKit Review Bot
Comment 11
2012-02-24 04:38:52 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug