[Webkit-unassigned] [Bug 79867] [BlackBerry] Upstream GraphicsLayerBlackBerry.{h, cpp}
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 7 02:49:36 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=79867
--- Comment #6 from Robin Cao <robin.cao at torchmobile.com.cn> 2012-03-07 02:49:35 PST ---
(In reply to comment #5)
> (From update of attachment 129652 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=129652&action=review
>
> Looks good, can be cleaned up some more.
>
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:54
> > +#include "PlatformString.h"
>
> Is PlatformString.h include really needed?
>
Good catch, this is already indirectly included in GraphicsLayer.h, so can be removed.
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:56
> > +using namespace std;
>
> Might not be needed if you use clampTo.
>
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:332
> > + float clampedOpacity = max(min(opacity, 1.0f), 0.0f);
>
> better use clampTo from MathExtras.h to make clear what you are doing here.
>
Fixed, clampTo is much more readable here.
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:356
> > + m_layer->setNeedsDisplayInRect(rect);
>
> You could look at putting some the one/two liners in the header, but only if you do not need to add another include....
>
Moving these two liner to header file will require one more include in the header. So I prefer not to move them.
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:567
> > +}
>
> Above two functions look very similar, can we share code?
>
The two functions look very similar, but they have some subtle differences, which make it hard to share code here. We can refactor the code later.
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:836
> > + m_contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
>
> better use m_contentsLayer->setPosition(m_contentsRect.location());
>
I made the following changes:
- m_contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
- m_contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
+ m_contentsLayer->setPosition(m_contentsRect.location());
+ m_contentsLayer->setBounds(m_contentsRect.size());
> > Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:853
> > + m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
>
> FloatPoint::zero
Fixed.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list