Bug 101426 - Coordinated Graphics: Decode an image directly into a GraphicsSurface.
Summary: Coordinated Graphics: Decode an image directly into a GraphicsSurface.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-06 21:22 PST by Dongseong Hwang
Modified: 2013-03-12 01:01 PDT (History)
5 users (show)

See Also:


Attachments
Partially working patch (30.74 KB, patch)
2012-11-13 10:48 PST, Noam Rosenthal
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2012-11-06 21:22:37 PST
We need to decode an image directly into a GraphicsSurface when the image is directly composited image that RenderLayerBacking give CoordinatedGraphicsLayer via setContentsToImage.
If we make it, we can save temporary memory and remove a copy overhead.
Comment 1 Noam Rosenthal 2012-11-13 10:48:13 PST
Created attachment 173925 [details]
Partially working patch

This shows how it can work, but I'm not sure yet if it's the way to go.
Comment 2 Dongseong Hwang 2013-03-12 01:01:18 PDT
I think you show the direction where we should go.

I think it would be better if we can change only ImageDecoder without changing BitmapImage and ImageSource.
I think we can do it as following chromium's approach. 
for instance, define as follow in NativeImagePtr.h

#elif PLATFORM(QT)
#if USE(GRAPHICS_SURFACE)
typedef GraphicsSurface* NativeImagePtr;
#else
typedef QPixmap* NativeImagePtr;
#endif

and every image decoders access NativeImagePtr's pixel.

btw, I think the most tricky blocker is caching mechanism of MemoryCache.
MemoryCache needs to remove decoded data of CachedImage. But if MemoryCache removes directed-composited image, UI Process encounters null pointer exception. we need to make the plan for this.