Your change to SkPDFImage.cpp could perhaps be smaller. You can use the helper method extractSubset(). ...
13 years, 10 months ago
(2011-01-28 19:09:28 UTC)
#2
Your change to SkPDFImage.cpp could perhaps be smaller. You can use the helper
method extractSubset().
SkBitmap src, dst;
SkIRect dst;
src.extractSubset(&dst, rect). This guy doesn't allocate new pixels, but will
point dst to the subset of src specified by rect. After this call, you can pass
dst wherever you would have passed src+rect.
On 2011/01/28 19:09:28, reed1 wrote: > Your change to SkPDFImage.cpp could perhaps be smaller. You ...
13 years, 10 months ago
(2011-01-28 21:27:09 UTC)
#3
On 2011/01/28 19:09:28, reed1 wrote:
> Your change to SkPDFImage.cpp could perhaps be smaller. You can use the helper
> method extractSubset().
>
> SkBitmap src, dst;
> SkIRect dst;
>
> src.extractSubset(&dst, rect). This guy doesn't allocate new pixels, but will
> point dst to the subset of src specified by rect. After this call, you can
pass
> dst wherever you would have passed src+rect.
I also cleaned up the code along with this change... making it more consistent
and logical. Using extractSubset on top of that cleanup doesn't really reduce
the diff much. Locally I updated it to use extractSubset and I like the version
in this CL better because extractSubset doesn't support kA1_Config (to come
shortly) and doesn't support kRLE_Index8_Config without copying. Always dealing
with srcRect directly makes the code more consistent.
Issue 4083045: [PDF] Honor srcRect in drawBitmap.
(Closed)
Created 13 years, 10 months ago by Steve VanDeBogart
Modified 13 years, 10 months ago
Reviewers: reed1
Base URL: http://skia.googlecode.com/svn/trunk
Comments: 0