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

Issue 6462084: When copying a bitmap, copy the generation ID. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by Leon
Modified:
11 years, 10 months ago
Reviewers:
bsalomon, DerekS, junov1
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

When copying a bitmap, copy the generation ID. Committed: https://code.google.com/p/skia/source/detail?r=5227

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Added a test for GPU bitmaps and modified fGenerationID directly. #

Total comments: 2

Patch Set 4 : readbacks #

Total comments: 5

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -1 line) Patch
M gyp/tests.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkPixelRef.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/core/SkBitmap.cpp View 1 2 3 chunks +10 lines, -0 lines 0 comments Download
M tests/BitmapCopyTest.cpp View 1 2 3 4 5 2 chunks +5 lines, -1 line 0 comments Download
A tests/GpuBitmapCopyTest.cpp View 1 2 3 4 1 chunk +108 lines, -0 lines 0 comments Download

Messages

Total messages: 17
Leon
Still need to modify the test so that it tests gpu bitmaps, but I wanted ...
11 years, 10 months ago (2012-08-20 18:18:39 UTC) #1
DerekS
pending the GPU test it lgtm
11 years, 10 months ago (2012-08-20 19:08:39 UTC) #2
bsalomon
http://codereview.appspot.com/6462084/diff/1004/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): http://codereview.appspot.com/6462084/diff/1004/include/core/SkPixelRef.h#newcode203 include/core/SkPixelRef.h:203: void setGenerationID(uint32_t genID) { fGenerationID = genID; } It ...
11 years, 10 months ago (2012-08-20 19:12:44 UTC) #3
Leon
https://codereview.appspot.com/6462084/diff/1004/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.appspot.com/6462084/diff/1004/include/core/SkPixelRef.h#newcode203 include/core/SkPixelRef.h:203: void setGenerationID(uint32_t genID) { fGenerationID = genID; } On ...
11 years, 10 months ago (2012-08-20 20:28:56 UTC) #4
DerekS
lgtm and do what you want with my comment. https://codereview.appspot.com/6462084/diff/8002/tests/BitmapCopyTest.cpp File tests/BitmapCopyTest.cpp (right): https://codereview.appspot.com/6462084/diff/8002/tests/BitmapCopyTest.cpp#newcode275 tests/BitmapCopyTest.cpp:275: ...
11 years, 10 months ago (2012-08-20 20:42:06 UTC) #5
bsalomon
I don't like the friend but I don't see any easy way around the memcpy ...
11 years, 10 months ago (2012-08-20 20:54:27 UTC) #6
Leon
https://codereview.appspot.com/6462084/diff/3003/tests/GpuBitmapCopyTest.cpp File tests/GpuBitmapCopyTest.cpp (right): https://codereview.appspot.com/6462084/diff/3003/tests/GpuBitmapCopyTest.cpp#newcode90 tests/GpuBitmapCopyTest.cpp:90: REPORTER_ASSERT(reporter, !memcmp(srcP, dstP, srcReadBack.getSize())); Is this what you had ...
11 years, 10 months ago (2012-08-20 22:05:45 UTC) #7
bsalomon
Sorry meant to send this much earlier this morning but never hit publish. http://codereview.appspot.com/6462084/diff/3003/tests/GpuBitmapCopyTest.cpp File ...
11 years, 10 months ago (2012-08-21 15:40:10 UTC) #8
Leon
http://codereview.appspot.com/6462084/diff/3003/tests/GpuBitmapCopyTest.cpp File tests/GpuBitmapCopyTest.cpp (right): http://codereview.appspot.com/6462084/diff/3003/tests/GpuBitmapCopyTest.cpp#newcode90 tests/GpuBitmapCopyTest.cpp:90: REPORTER_ASSERT(reporter, !memcmp(srcP, dstP, srcReadBack.getSize())); On 2012/08/21 15:40:10, bsalomon wrote: ...
11 years, 10 months ago (2012-08-21 15:47:19 UTC) #9
junov1
http://codereview.appspot.com/6462084/diff/3003/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): http://codereview.appspot.com/6462084/diff/3003/include/core/SkPixelRef.h#newcode198 include/core/SkPixelRef.h:198: friend class SkBitmap; I'm not sure this is the ...
11 years, 10 months ago (2012-08-21 17:36:26 UTC) #10
DerekS
http://codereview.appspot.com/6462084/diff/3003/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): http://codereview.appspot.com/6462084/diff/3003/include/core/SkPixelRef.h#newcode198 include/core/SkPixelRef.h:198: friend class SkBitmap; There are some subtleties to this ...
11 years, 10 months ago (2012-08-21 17:49:12 UTC) #11
Leon
Yes, copying SkPixelRef is tricky. However, I did just look at SkMallocPixelRef, and it turns ...
11 years, 10 months ago (2012-08-21 17:57:27 UTC) #12
DerekS
On 2012/08/21 17:57:27, scroggo-work wrote: > Yes, copying SkPixelRef is tricky. > > However, I ...
11 years, 10 months ago (2012-08-21 19:15:17 UTC) #13
Leon
I've uploaded a new patch that fixes the test. Right now, there is SkPixelRef::deepCopy, which ...
11 years, 10 months ago (2012-08-21 20:44:18 UTC) #14
Leon
Personally, I don't like telling the pixel ref what its own config is, but I ...
11 years, 10 months ago (2012-08-21 20:49:35 UTC) #15
bsalomon
On 2012/08/21 20:44:18, scroggo-work wrote: > I've uploaded a new patch that fixes the test. ...
11 years, 10 months ago (2012-08-21 20:50:39 UTC) #16
DerekS
11 years, 10 months ago (2012-08-21 20:59:06 UTC) #17
I agree with Brian.


On Tue, Aug 21, 2012 at 4:50 PM, <bsalomon@google.com> wrote:

> On 2012/08/21 20:44:18, scroggo-work wrote:
>
>> I've uploaded a new patch that fixes the test.
>>
>
>  Right now, there is SkPixelRef::deepCopy, which takes a destination
>>
> config and
>
>> returns a new SkPixelRef (or NULL). I could use that. However, as you
>>
> point out,
>
>> SkMallocPixelRef does not know its own config, so I'd need to pass
>>
> that as well.
>
>> I could make SkMallocPixelRef::deepCopy return NULL if the two do not
>>
> match.
>
>  Does that sound like a better approach?
>>
>
> IMO there is a larger refactor that involves moving more info from
> SkBitmap to SkPixelRef that is outside the scope of this CL and needn't
> be addressed by this change.
>
>
>
http://codereview.appspot.com/**6462084/<http://codereview.appspot.com/6462084/>
>
Sign in to reply to this message.

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