Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(68)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 53082: Support Index8 in SkBitmap.copyTo()

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 8 months ago by weita
Modified:
10 years, 10 months ago
Reviewers:
reed
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.
Allow copying an Index8 bitmap when srcConfig and dstConfig are both Index8. Also, change the logic of SkBitmap.copyTo() to do memcpy() if srcConfig and dstConfig are the same.

Patch Set 1 #

Total comments: 10

Patch Set 2 : Add Patch Set 2 #

Total comments: 4

Patch Set 3 : Done with the pervious comments and pass tests #

Created: 16 years, 8 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -89 lines) Patch
include/core/SkBitmap.h View 1 2 18 chunks +29 lines, -25 lines 0 comments Download
src/core/SkBitmap.cpp View 1 2 22 chunks +69 lines, -45 lines 0 comments Download
src/core/SkColorTable.cpp View 1 3 chunks +24 lines, -12 lines 0 comments Download
tests/BitmapCopyTest.cpp View 4 chunks +8 lines, -7 lines 0 comments Download
Total messages: 8
|
weita
16 years, 8 months ago (2009年05月01日 17:49:41 UTC) #1
Sign in to reply to this message.
reed
http://codereview.appspot.com/53082/diff/1/2 File include/core/SkBitmap.h (right): http://codereview.appspot.com/53082/diff/1/2#newcode490 Line 490: SkColorTable(const SkColorTable& src); Is the comment above this ...
16 years, 8 months ago (2009年05月01日 18:04:59 UTC) #2
http://codereview.appspot.com/53082/diff/1/2
File include/core/SkBitmap.h (right):
http://codereview.appspot.com/53082/diff/1/2#newcode490
Line 490: SkColorTable(const SkColorTable& src);
Is the comment above this constructor correct? It should say: makes a deep-copy
of the src colortable.
http://codereview.appspot.com/53082/diff/1/3
File src/core/SkBitmap.cpp (right):
http://codereview.appspot.com/53082/diff/1/3#newcode699
Line 699: case kIndex8_Config:
indent the "if" block, as the return false is indented below
http://codereview.appspot.com/53082/diff/1/3#newcode708
Line 708: tmp.setConfig(dstConfig, this->width(), this->height());
Can we refactor this so there is only one shared call to allocPixels, perhaps
with a ctable ptr that is sometimes NULL?
Also, you can use SkAutoUnref au(ctable) after you (optionally) allocated it.
This guy will take care of calling unref() for you, so you can just return false
if allocPixels() fails.
http://codereview.appspot.com/53082/diff/1/3#newcode731
Line 731: 
don't exceed 80-columns in the comment
http://codereview.appspot.com/53082/diff/1/4
File src/core/SkColorTable.cpp (right):
http://codereview.appspot.com/53082/diff/1/4#newcode39
Line 39: SkColorTable::SkColorTable(const SkColorTable& src) {
Need to initialize f16Bitcache and fFlags
Sign in to reply to this message.
weita
http://codereview.appspot.com/53082/diff/1/2 File include/core/SkBitmap.h (right): http://codereview.appspot.com/53082/diff/1/2#newcode490 Line 490: SkColorTable(const SkColorTable& src); On 2009年05月01日 18:04:59, reed wrote: ...
16 years, 8 months ago (2009年05月01日 19:05:08 UTC) #3
http://codereview.appspot.com/53082/diff/1/2
File include/core/SkBitmap.h (right):
http://codereview.appspot.com/53082/diff/1/2#newcode490
Line 490: SkColorTable(const SkColorTable& src);
On 2009年05月01日 18:04:59, reed wrote:
> Is the comment above this constructor correct? It should say: makes a
deep-copy
> of the src colortable.
Done.
The original comment should stick with SkColorTalbe(int count). I add a new
comment for the new constructor.
http://codereview.appspot.com/53082/diff/1/3
File src/core/SkBitmap.cpp (right):
http://codereview.appspot.com/53082/diff/1/3#newcode699
Line 699: case kIndex8_Config:
On 2009年05月01日 18:04:59, reed wrote:
> indent the "if" block, as the return false is indented below
Done.
http://codereview.appspot.com/53082/diff/1/3#newcode708
Line 708: tmp.setConfig(dstConfig, this->width(), this->height());
On 2009年05月01日 18:04:59, reed wrote:
> Can we refactor this so there is only one shared call to allocPixels, perhaps
> with a ctable ptr that is sometimes NULL?
> 
> Also, you can use SkAutoUnref au(ctable) after you (optionally) allocated it.
> This guy will take care of calling unref() for you, so you can just return
false
> if allocPixels() fails.
Done.
http://codereview.appspot.com/53082/diff/1/3#newcode731
Line 731: 
On 2009年05月01日 18:04:59, reed wrote:
> don't exceed 80-columns in the comment
Done.
http://codereview.appspot.com/53082/diff/1/4
File src/core/SkColorTable.cpp (right):
http://codereview.appspot.com/53082/diff/1/4#newcode39
Line 39: SkColorTable::SkColorTable(const SkColorTable& src) {
On 2009年05月01日 18:04:59, reed wrote:
> Need to initialize f16Bitcache and fFlags
Done.
Sign in to reply to this message.
weita
Add Patch Set 2
16 years, 8 months ago (2009年05月01日 19:22:41 UTC) #4
Add Patch Set 2
Sign in to reply to this message.
reed
much better! http://codereview.appspot.com/53082/diff/9/1006 File include/core/SkBitmap.h (right): http://codereview.appspot.com/53082/diff/9/1006#newcode488 Line 488: /** Lets just say we make ...
16 years, 8 months ago (2009年05月01日 19:58:17 UTC) #5
much better!
http://codereview.appspot.com/53082/diff/9/1006
File include/core/SkBitmap.h (right):
http://codereview.appspot.com/53082/diff/9/1006#newcode488
Line 488: /**
Lets just say we make a deep copy of the colors. Mentioning fColors is a little
impl-specific (and won't make sense if read from some external doxygen
documentation.)
http://codereview.appspot.com/53082/diff/9/1006#newcode493
Line 493: /** Constructs an empty color table (zero colors).
I know this isn't your comment (its mine!), but it should really say something
like: preallocate the colortable to have 'count' colors, which are initially set
to 0
Sign in to reply to this message.
weita
Done with the pervious comments and pass tests
16 years, 8 months ago (2009年05月01日 21:53:16 UTC) #6
Done with the pervious comments and pass tests
Sign in to reply to this message.
weita
http://codereview.appspot.com/53082/diff/9/1006 File include/core/SkBitmap.h (right): http://codereview.appspot.com/53082/diff/9/1006#newcode488 Line 488: /** On 2009年05月01日 19:58:18, reed wrote: > Lets ...
16 years, 8 months ago (2009年05月01日 21:55:49 UTC) #7
http://codereview.appspot.com/53082/diff/9/1006
File include/core/SkBitmap.h (right):
http://codereview.appspot.com/53082/diff/9/1006#newcode488
Line 488: /**
On 2009年05月01日 19:58:18, reed wrote:
> Lets just say we make a deep copy of the colors. Mentioning fColors is a
little
> impl-specific (and won't make sense if read from some external doxygen
> documentation.)
Done.
http://codereview.appspot.com/53082/diff/9/1006#newcode493
Line 493: /** Constructs an empty color table (zero colors).
On 2009年05月01日 19:58:18, reed wrote:
> I know this isn't your comment (its mine!), but it should really say something
> like: preallocate the colortable to have 'count' colors, which are initially
set
> to 0
Done.
Sign in to reply to this message.
reed
LGTM
16 years, 8 months ago (2009年05月02日 01:52:32 UTC) #8
LGTM
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /