Pretty small change but maybe requires some explanation: WebKit gives us RGBA data. When we ...
12 years, 11 months ago
(2011-11-18 14:10:34 UTC)
#1
Pretty small change but maybe requires some explanation:
WebKit gives us RGBA data. When we get a putImageData in JS it goes through
GrContext::writeRenderTargetPixels(). We upload the data to a scratch texture
and then draw from that texture to the RT. During this draw we convert from
unpremultiplied-alpha to premultiplied-alpha.
Currently the scratch texture is RGBA, matching WebKit's order. When we upload
WK's data to the texture in ANGLE it does a sw swizzle and behind our backs the
texture is really BGRA.
With this change we'll pretend to GL that the original data is BGRA during the
texture upload but then do the R/B swap during the draw (which is free).
There is no measurable end-to-end performance increase because the ANGLE swizzle
is SSE2 accelerated. But CPU utilization is reduced so it is still win.
(The early out added in internalWriteRenderTargetPixels is unrelated to the
above).
LGTM. Thanks for the explanation. http://codereview.appspot.com/5417046/diff/2001/src/gpu/GrGpuGL.cpp File src/gpu/GrGpuGL.cpp (right): http://codereview.appspot.com/5417046/diff/2001/src/gpu/GrGpuGL.cpp#newcode448 src/gpu/GrGpuGL.cpp:448: These two functions are ...
12 years, 11 months ago
(2011-11-18 14:56:16 UTC)
#2
Issue 5417046: Write direct to RT/Tex when possible, use BGRA rather than RGBA intermediate texture on ANGLE
(Closed)
Created 12 years, 11 months ago by bsalomon
Modified 12 years, 11 months ago
Reviewers: TomH
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 1