Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(550)

Issue 6344076: Remove Bitmaps Raw Pixel Support. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by DerekS
Modified:
12 years, 11 months ago
Reviewers:
TomH, junov1, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Remove Bitmaps Raw Pixel Support. bitmap.setPixels(...) now creates a mutable pixelRef instead of just setting fPixels.

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : add padding when restoring #

Total comments: 4

Patch Set 4 : fix comments #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -77 lines) Patch
M include/core/SkBitmap.h View 1 2 3 4 3 chunks +5 lines, -10 lines 0 comments Download
M include/core/SkMallocPixelRef.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M src/core/SkBitmap.cpp View 1 2 3 4 9 chunks +8 lines, -63 lines 2 comments Download
M src/core/SkMallocPixelRef.cpp View 1 2 3 4 3 chunks +6 lines, -2 lines 2 comments Download
M src/core/SkPixelRef.cpp View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 13
DerekS
13 years ago (2012-07-03 19:16:04 UTC) #1
DerekS
13 years ago (2012-07-03 20:05:18 UTC) #2
reed1
https://codereview.appspot.com/6344076/diff/4001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.appspot.com/6344076/diff/4001/src/core/SkBitmap.cpp#newcode1444 src/core/SkBitmap.cpp:1444: } else { might be simplier to use (as ...
12 years, 11 months ago (2012-07-09 14:14:26 UTC) #3
DerekS
https://codereview.appspot.com/6344076/diff/4001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.appspot.com/6344076/diff/4001/src/core/SkBitmap.cpp#newcode1444 src/core/SkBitmap.cpp:1444: } else { On 2012/07/09 14:14:26, reed1 wrote: > ...
12 years, 11 months ago (2012-07-16 13:13:58 UTC) #4
junov1
I would like to see a gm test that draws multiple subsets of the same ...
12 years, 11 months ago (2012-07-16 13:40:07 UTC) #5
TomH
Maybe I'm missing something, Justin - why do you expect performance degradation?
12 years, 11 months ago (2012-07-16 14:05:50 UTC) #6
DerekS
On 2012/07/16 14:05:50, TomH wrote: > Maybe I'm missing something, Justin - why do you ...
12 years, 11 months ago (2012-07-16 14:14:36 UTC) #7
DerekS
On 2012/07/16 14:14:36, DerekS wrote: > On 2012/07/16 14:05:50, TomH wrote: > > Maybe I'm ...
12 years, 11 months ago (2012-07-18 13:59:26 UTC) #8
reed1
http://codereview.appspot.com/6344076/diff/16001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): http://codereview.appspot.com/6344076/diff/16001/src/core/SkBitmap.cpp#newcode358 src/core/SkBitmap.cpp:358: bool SkBitmap::lockPixelsAreWritable() const { return (I don't think we ...
12 years, 11 months ago (2012-07-18 14:33:36 UTC) #9
DerekS
http://codereview.appspot.com/6344076/diff/16001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): http://codereview.appspot.com/6344076/diff/16001/src/core/SkBitmap.cpp#newcode358 src/core/SkBitmap.cpp:358: bool SkBitmap::lockPixelsAreWritable() const { On 2012/07/18 14:33:36, reed1 wrote: ...
12 years, 11 months ago (2012-07-18 14:56:16 UTC) #10
junov1
> 3. Fix picture recording to always serialize a mutable bitmap when we first see ...
12 years, 11 months ago (2012-07-18 15:10:01 UTC) #11
DerekS
On 2012/07/18 15:10:01, junov1 wrote: > > 3. Fix picture recording to always serialize a ...
12 years, 11 months ago (2012-07-18 15:27:14 UTC) #12
junov1
12 years, 11 months ago (2012-07-18 16:04:15 UTC) #13
So genID + subrect would be an appropriate key?
I think doing that would address the correctness concerns I raised earlier.

I am still concerned about performance for the sprite map use case: When
all (or almost all) of the source bitmap ends up being used to draw a
frame, but we only use one subrect at a time, do we get a significant
performance degradation from the additional overhead of breaking up the
bitmap and serializing it one subrect at a time?  I would like to get an
idea of how this will impact GPU rendering, in particular, we will be
multiplying the quantity of texture uploads by doing this, and we may end
up hitting the object count ceiling of the texture cache much faster.

Looking at SkGpuDevice::lockCachedTexture, it seems like the texture cache
is building a key that takes into account genID, pixelRefOffset, width and
height. Therefore, I am pretty sure the texture cache can robustly handle
subset bitmaps robustly when rendering directly.  During SkPicture
playback, it might be trickier, depending on how the subsets are
unflattened.

On Wed, Jul 18, 2012 at 11:27 AM, <djsollen@google.com> wrote:

> On 2012/07/18 15:10:01, junov1 wrote:
>
>> > 3. Fix picture recording to always serialize a mutable bitmap when
>>
> we first
>
>> see
>> > it. This is hidden behind a flag currently and should be the default
>>
> behavior.
>
>  Don't forget to check the pixelRef's genID because mutable bitmaps may
>>
> be
>
>> modified at any time, so they may need to be re-serialized.
>>
>
> Yep, it is actually deeper than that as right now we have a bug in
> picture recording because we assume that if the pixelRef has the right
> genId then the bitmaps are the same and we don't create another
> dictionary entry in the picture.  This causes a problem when we have
> extracted a bitmap from another bitmap, because while they share the
> sample pixelRef (with the same ref count) they have different dimensions
> and offsets.  I plan on fixing that in my second CL.
>
>
http://codereview.appspot.com/**6344076/<http://codereview.appspot.com/6344076/>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b