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

Issue 6847122: Create a factory to decode an SkBitmap from an SkData. (Closed)

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

Description

Create a factory to decode an SkBitmap from an SkData. Add a test and a GM for the factory, and a PNG file for it to decode. The PNG file is copyright-free, obtained from http://openclipart.org/detail/29213/paper-plane-by-ddoo In cmykjpeg, do not attempt to decode in the constructor, since it currently crashes on Mac (if you provide the correct resource path). Even when we fix this crash there is no need to do it in the constructor, since we create all of the gms in order to get their names (to determine whether to run them). Committed: https://code.google.com/p/skia/source/detail?r=6618

Patch Set 1 #

Total comments: 2

Patch Set 2 : Respond to comments. #

Total comments: 3

Patch Set 3 : Respond to comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -1 line) Patch
M gm/cmykjpeg.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
A gm/factory.cpp View 1 2 1 chunk +67 lines, -0 lines 0 comments Download
A gm/resources/plane.png View 0 chunks +-1 lines, --1 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/images.gyp View 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A include/images/SkBitmapFactory.h View 1 2 1 chunk +46 lines, -0 lines 0 comments Download
A src/images/SkBitmapFactory.cpp View 1 2 1 chunk +41 lines, -0 lines 0 comments Download
A tests/BitmapFactoryTest.cpp View 1 2 1 chunk +76 lines, -0 lines 0 comments Download

Messages

Total messages: 5
Leon
12 years ago (2012-11-28 23:30:05 UTC) #1
reed1
At some point I anticipate wanting this to be a function-ptr or base-class, so we ...
12 years ago (2012-11-29 14:27:31 UTC) #2
Leon
> At some point I anticipate wanting this to be a function-ptr or base-class, so ...
12 years ago (2012-11-29 17:53:06 UTC) #3
reed1
parameter nit, but good start. lgtm https://codereview.appspot.com/6847122/diff/5001/include/images/SkBitmapFactory.h File include/images/SkBitmapFactory.h (right): https://codereview.appspot.com/6847122/diff/5001/include/images/SkBitmapFactory.h#newcode30 include/images/SkBitmapFactory.h:30: static bool DecodeBitmap(const ...
12 years ago (2012-11-29 18:55:23 UTC) #4
Leon
12 years ago (2012-11-29 19:16:01 UTC) #5
https://codereview.appspot.com/6847122/diff/5001/include/images/SkBitmapFacto...
File include/images/SkBitmapFactory.h (right):

https://codereview.appspot.com/6847122/diff/5001/include/images/SkBitmapFacto...
include/images/SkBitmapFactory.h:30: static bool DecodeBitmap(const SkData*,
SkBitmap*, bool boundsOnly = false);
On 2012/11/29 18:55:23, reed1 wrote:
> On 2012/11/29 17:53:06, scroggo-work wrote:
> > Instead of passing a bool, should I just use SkImageDecoder::Mode?
> 
> An enum is preferable to a bool, true. I wouldn't bring in SkImageDecoder.h
for
> that tho, lets just makeup a new one.

Done.

> Small nit to put the bitmap* first or last, so that all of the input
parameters
> are on one side or the other.

Moved the bitmap first, so we can keep the optional parameter.
Sign in to reply to this message.

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