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

Issue 6884054: In SKP serialization, use existing encoded data. (Closed)

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

Description

In SKP serialization, use existing encoded data. If an SkBitmap has encoded data, write that during serialization rather than reencoding it. Add a test to ensure that this does not modify the output stream, so the reader need not know the difference. Committed: https://code.google.com/p/skia/source/detail?r=6732

Patch Set 1 #

Patch Set 2 : Modified some comments. #

Total comments: 8

Patch Set 3 : #

Patch Set 4 : Disallow having both a heap and encoder function. #

Total comments: 2

Patch Set 5 : Assert when trying to set both a heap and encoder function. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -41 lines) Patch
M src/core/SkOrderedWriteBuffer.h View 1 2 3 4 1 chunk +13 lines, -9 lines 0 comments Download
M src/core/SkOrderedWriteBuffer.cpp View 1 2 3 4 3 chunks +78 lines, -32 lines 0 comments Download
M tests/PictureTest.cpp View 2 chunks +68 lines, -0 lines 0 comments Download

Messages

Total messages: 11
Leon
https://codereview.appspot.com/6884054/diff/2001/src/core/SkOrderedWriteBuffer.cpp File src/core/SkOrderedWriteBuffer.cpp (right): https://codereview.appspot.com/6884054/diff/2001/src/core/SkOrderedWriteBuffer.cpp#newcode146 src/core/SkOrderedWriteBuffer.cpp:146: if (fBitmapHeap != NULL) { Does this seem like ...
11 years, 11 months ago (2012-12-06 19:35:08 UTC) #1
reed1
Not sure I understand how the BitmapHeap is involved here. From a simplistic read of ...
11 years, 11 months ago (2012-12-06 21:24:06 UTC) #2
reed1
https://codereview.appspot.com/6884054/diff/2001/tests/PictureTest.cpp File tests/PictureTest.cpp (right): https://codereview.appspot.com/6884054/diff/2001/tests/PictureTest.cpp#newcode334 tests/PictureTest.cpp:334: SkASSERT(stream != NULL); Perhaps we should do this copyToData() ...
11 years, 11 months ago (2012-12-06 21:25:27 UTC) #3
DerekS
https://codereview.appspot.com/6884054/diff/2001/src/core/SkOrderedWriteBuffer.cpp File src/core/SkOrderedWriteBuffer.cpp (right): https://codereview.appspot.com/6884054/diff/2001/src/core/SkOrderedWriteBuffer.cpp#newcode145 src/core/SkOrderedWriteBuffer.cpp:145: // version. Only do this in the case where ...
11 years, 11 months ago (2012-12-06 21:52:05 UTC) #4
Leon
> Not sure I understand how the BitmapHeap is involved here. From a simplistic > ...
11 years, 11 months ago (2012-12-06 22:46:23 UTC) #5
DerekS
If you have both encoded data and a bitmap heap I agree that it should ...
11 years, 11 months ago (2012-12-07 17:57:09 UTC) #6
Leon
On Fri, Dec 7, 2012 at 12:57 PM, Derek Sollenberger <djsollen@google.com>wrote: > If you have ...
11 years, 11 months ago (2012-12-07 18:13:30 UTC) #7
DerekS
If there is a heap I think we should always default to the heap, since ...
11 years, 11 months ago (2012-12-07 18:19:26 UTC) #8
Leon
Uploaded a new patch. This patch ensures that you only have a heap or an ...
11 years, 11 months ago (2012-12-07 21:22:04 UTC) #9
DerekS
lgtm with one nit https://codereview.appspot.com/6884054/diff/13001/src/core/SkOrderedWriteBuffer.h File src/core/SkOrderedWriteBuffer.h (right): https://codereview.appspot.com/6884054/diff/13001/src/core/SkOrderedWriteBuffer.h#newcode91 src/core/SkOrderedWriteBuffer.h:91: * Incompatible with the SkBitmapHeap. ...
11 years, 11 months ago (2012-12-07 21:46:03 UTC) #10
Leon
11 years, 11 months ago (2012-12-07 22:03:36 UTC) #11
https://codereview.appspot.com/6884054/diff/13001/src/core/SkOrderedWriteBuff...
File src/core/SkOrderedWriteBuffer.h (right):

https://codereview.appspot.com/6884054/diff/13001/src/core/SkOrderedWriteBuff...
src/core/SkOrderedWriteBuffer.h:91: * Incompatible with the SkBitmapHeap. If an
encoder is set fBitmapHeap will be set to NULL.
On 2012/12/07 21:46:03, DerekS wrote:
> I lean towards firing an SkASSERT if they try this.  In release mode we should
> still set it to NULL, but in theory I would prefer to make the caller have to
do
> this manually so they know the implications.
> 
> setBitmapHeap(NULL)
> setBitmapEncoder(foo)

Done.
Sign in to reply to this message.

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