[Webkit-unassigned] [Bug 27511] Add WinCE specific platform/graphics files to WebCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 10 11:12:03 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27511





--- Comment #83 from Peter Kasting <pkasting at google.com>  2009-08-10 11:12:02 PDT ---
Please follow Eric's suggestion and split these patches into their own bugs. 
This is getting unwieldy.

(In reply to comment #82)
> Every other port? What is this?
> 
> typedef CGImageRef NativeImagePtr;

>From the way the CG code uses that it seems like it works like a typedef to a
pointer to a refcounting object.  They're certainly still explicitly releasing
it: see the CGImageRelease() call in ImageCG.cpp:FrameData::clear().

But perhaps I am mistaken about what that type is.  

> Using smart pointers is definitely an advantage, for example, it can avoid
> memory leaks (about 1.5 year ago, there was a bug that FrameData leaked. Now it
> has been fixed. but if all platform NativeImagePtr were reference counted, it
> wouldn't even be a problem, and "clear(true)" wouldn't necessary in
> ~FrameData()).

As noted above, even CG does an explicit release here.  I am not assuaged.

> Not mentioning that we use SharedBitmap as both decoding buffer
> and rendering buffer so that no extra memory copying is requried.

Yes, that is how other ports e.g. CG and Skia work too.  For Skia, for example,
the setRGBA() call in ImageDecoder.h writes directly to the buffer inside the
SkBitmap.

> Generally, I don't think it's a good idea to throw away helpful changes just
> because we want to be same as other ports.

Generally, things that one port does differently from everyone else raise red
flags for people trying to read the code.

> If we do everything in the same way, why do we
> need ports?

Because all the ports are built atop cross-platform code.  They should only be
different where they must, and we're in the process of trying to reduce the
differences further.

I wasn't saying your code is guaranteed to be wrong.  I was saying I'm unable
to tell for sure that it's right, whereas if your NativeImage type internally
refcounted, and NativeImagePtr was a raw pointer, I wouldn't even have to
worry, because the idiom is the same.  All I'd need to check is that you
allocated and freed in the right places.  The strength of copying other ports
is that we can review your code and guarantee it's correct, and others can read
and understand what you're doing.  It's the same reason we have style guides.

-- 
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