Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (Closed)

Created:
7 years, 1 month ago by reed1
Modified:
7 years ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

PixelRef now returns (nearly) everything that is currently in SkBitmap. The goal is to refactor bitmap later to remove redundancy, and more interestingly, remove the chance for a disconnect between the actual (pixelref) rowbytes and config, and the one claimed by the bitmap. R=mtklein@google.com, scroggo@google.com Committed: https://code.google.com/p/skia/source/detail?r=12537

Patch Set 1 #

Patch Set 2 : #

Total comments: 32

Patch Set 3 : #

Total comments: 20

Patch Set 4 : #

Patch Set 5 : #

Total comments: 1

Patch Set 6 : rebase #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 7

Patch Set 9 : #

Patch Set 10 : add SK_SUPPORT_LEGACY_ONLOCKPIXELS so we can land in stages for Chrome #

Total comments: 13

Patch Set 11 : #

Patch Set 12 : a -> b === !b -> !a #

Patch Set 13 : new convention: require SkImageInfo in constructor #

Total comments: 4

Patch Set 14 : rebase #

Patch Set 15 : rebase #

Patch Set 16 : #

Total comments: 25

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Patch Set 20 : undo mod to GpuBitmapCopy test, and change bitmapdevice to not ask for alloc w/ kNo_Config #

Unified diffs Side-by-side diffs Delta from patch set Stats (+656 lines, -268 lines) Patch
M include/core/SkBitmap.h View 1 2 3 4 5 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M include/core/SkBitmapDevice.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M include/core/SkImageInfo.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +19 lines, -0 lines 0 comments Download
M include/core/SkMallocPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +35 lines, -16 lines 0 comments Download
M include/core/SkPicture.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M include/core/SkPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +63 lines, -18 lines 0 comments Download
M include/gpu/GrSurface.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M include/gpu/SkGr.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M include/gpu/SkGrPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -6 lines 0 comments Download
M include/images/SkImageRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +3 lines, -4 lines 0 comments Download
M include/images/SkImageRef_GlobalPool.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M samplecode/SamplePicture.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -1 line 0 comments Download
M src/core/SkBitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +84 lines, -9 lines 0 comments Download
M src/core/SkBitmapDevice.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +17 lines, -18 lines 0 comments Download
M src/core/SkImageFilterUtils.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +13 lines, -3 lines 0 comments Download
M src/core/SkMallocPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +111 lines, -20 lines 0 comments Download
M src/core/SkMaskFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -2 lines 0 comments Download
M src/core/SkPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +61 lines, -14 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M src/gpu/GrSurface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -0 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +20 lines, -8 lines 0 comments Download
M src/gpu/SkGr.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +30 lines, -0 lines 0 comments Download
M src/gpu/SkGrPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +24 lines, -8 lines 0 comments Download
M src/image/SkDataPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -3 lines 0 comments Download
M src/image/SkDataPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +18 lines, -7 lines 0 comments Download
M src/image/SkImage_Raster.cpp View 1 1 chunk +2 lines, -4 lines 0 comments Download
M src/image/SkSurface_Raster.cpp View 1 2 3 4 1 chunk +3 lines, -13 lines 0 comments Download
M src/images/SkImageRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +11 lines, -20 lines 0 comments Download
M src/images/SkImageRef_GlobalPool.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -3 lines 0 comments Download
M src/lazy/SkCachingPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M src/lazy/SkCachingPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +19 lines, -15 lines 0 comments Download
M src/lazy/SkDiscardablePixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -4 lines 0 comments Download
M src/lazy/SkDiscardablePixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +23 lines, -15 lines 0 comments Download
M tests/DrawBitmapRectTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M tests/PictureTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +3 lines, -32 lines 0 comments Download
M tests/PixelRefTest.cpp View 1 2 3 4 1 chunk +13 lines, -11 lines 0 comments Download
M tests/SerializationTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
reed1
not ready for primetime, but getting there.
7 years, 1 month ago (2013-11-19 16:37:10 UTC) #1
scroggo
https://codereview.chromium.org/68973005/diff/30001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/30001/include/core/SkImageInfo.h#newcode66 include/core/SkImageInfo.h:66: kARGB_4444_SkColorType, Nooo! https://codereview.chromium.org/68973005/diff/30001/include/core/SkImageInfo.h#newcode130 include/core/SkImageInfo.h:130: * @param length Amount of ...
7 years, 1 month ago (2013-11-19 18:17:08 UTC) #2
reed1
https://codereview.chromium.org/68973005/diff/30001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/30001/include/core/SkImageInfo.h#newcode130 include/core/SkImageInfo.h:130: * @param length Amount of memory available in the ...
7 years, 1 month ago (2013-11-20 20:21:30 UTC) #3
reed1
https://codereview.chromium.org/68973005/diff/30001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/68973005/diff/30001/src/core/SkBitmap.cpp#newcode460 src/core/SkBitmap.cpp:460: this->setPixelRef(new SkMallocPixelRef(info, p, fRowBytes, ctable, false))->unref(); On 2013/11/19 18:17:09, ...
7 years, 1 month ago (2013-11-20 20:56:56 UTC) #4
reed1
I think I addressed leon's initial comments
7 years, 1 month ago (2013-11-20 21:01:53 UTC) #5
scroggo
Do the A1 changes need to be included here? https://codereview.chromium.org/68973005/diff/150001/include/core/SkMallocPixelRef.h File include/core/SkMallocPixelRef.h (right): https://codereview.chromium.org/68973005/diff/150001/include/core/SkMallocPixelRef.h#newcode24 include/core/SkMallocPixelRef.h:24: ...
7 years, 1 month ago (2013-11-20 21:04:27 UTC) #6
reed1
removing A1 support is (I think) a prerequisite for this CL to land. https://codereview.chromium.org/68973005/diff/150001/include/core/SkMallocPixelRef.h File ...
7 years, 1 month ago (2013-11-20 21:27:17 UTC) #7
scroggo
lgtm https://codereview.chromium.org/68973005/diff/150001/include/core/SkMallocPixelRef.h File include/core/SkMallocPixelRef.h (right): https://codereview.chromium.org/68973005/diff/150001/include/core/SkMallocPixelRef.h#newcode24 include/core/SkMallocPixelRef.h:24: * specified colortable (if not NULL). On 2013/11/20 ...
7 years, 1 month ago (2013-11-20 21:35:18 UTC) #8
scroggo
https://codereview.chromium.org/68973005/diff/380001/include/core/SkMallocPixelRef.h File include/core/SkMallocPixelRef.h (right): https://codereview.chromium.org/68973005/diff/380001/include/core/SkMallocPixelRef.h#newcode30 include/core/SkMallocPixelRef.h:30: static SkMallocPixelRef* NewDirect(const SkImageInfo&, void* addr, Nit on the ...
7 years, 1 month ago (2013-11-20 21:44:15 UTC) #9
reed1
Patch #7 Renamed onLockPixels to onNewLockPixels, so we can stage the change in Chrome, which ...
7 years ago (2013-12-04 15:23:25 UTC) #10
reed1
Reviewers, please look at least at the new signature in SkPixelRef.h for onNewLockPixels and onGetInfo
7 years ago (2013-12-04 16:41:24 UTC) #11
scroggo
lgtm at patchset 8, with some nits. https://codereview.chromium.org/68973005/diff/560001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/560001/include/core/SkImageInfo.h#newcode132 include/core/SkImageInfo.h:132: void write(SkFlattenableWriteBuffer&) ...
7 years ago (2013-12-04 18:14:02 UTC) #12
hal.canary
https://codereview.chromium.org/68973005/diff/560001/src/core/SkMallocPixelRef.cpp File src/core/SkMallocPixelRef.cpp (right): https://codereview.chromium.org/68973005/diff/560001/src/core/SkMallocPixelRef.cpp#newcode108 src/core/SkMallocPixelRef.cpp:108: bool SkMallocPixelRef::onGetInfo(SkImageInfo* info) { Is this ever called if ...
7 years ago (2013-12-04 19:07:09 UTC) #13
reed1
On 2013/12/04 19:07:09, Hal Canary wrote: > https://codereview.chromium.org/68973005/diff/560001/src/core/SkMallocPixelRef.cpp > File src/core/SkMallocPixelRef.cpp (right): > > https://codereview.chromium.org/68973005/diff/560001/src/core/SkMallocPixelRef.cpp#newcode108 ...
7 years ago (2013-12-04 19:50:58 UTC) #14
reed1
https://codereview.chromium.org/68973005/diff/560001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/560001/include/core/SkImageInfo.h#newcode132 include/core/SkImageInfo.h:132: void write(SkFlattenableWriteBuffer&) const; On 2013/12/04 18:14:03, scroggo wrote: > ...
7 years ago (2013-12-04 21:12:53 UTC) #15
mtklein
https://codereview.chromium.org/68973005/diff/600001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/68973005/diff/600001/include/core/SkPicture.h#newcode227 include/core/SkPicture.h:227: static const uint32_t PICTURE_VERSION = 17; You may want ...
7 years ago (2013-12-04 22:45:59 UTC) #16
scroggo
Still lgtm https://codereview.chromium.org/68973005/diff/600001/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.chromium.org/68973005/diff/600001/include/core/SkPixelRef.h#newcode58 include/core/SkPixelRef.h:58: struct LockRec { Maybe add a comment ...
7 years ago (2013-12-04 22:47:37 UTC) #17
reed1
https://codereview.chromium.org/68973005/diff/600001/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.chromium.org/68973005/diff/600001/include/core/SkPixelRef.h#newcode82 include/core/SkPixelRef.h:82: /** Call to access the pixel memory, which is ...
7 years ago (2013-12-05 13:32:38 UTC) #18
scroggo
https://codereview.chromium.org/68973005/diff/600001/src/core/SkPixelRef.cpp File src/core/SkPixelRef.cpp (right): https://codereview.chromium.org/68973005/diff/600001/src/core/SkPixelRef.cpp#newcode169 src/core/SkPixelRef.cpp:169: SkASSERT(!is_invalid(fInfo)); On 2013/12/05 13:32:39, reed1 wrote: > On 2013/12/04 ...
7 years ago (2013-12-05 13:45:34 UTC) #19
reed1
#13 -- very good idea (requiring SkImageInfo) -- lots to review :)
7 years ago (2013-12-05 16:44:56 UTC) #20
mtklein
lgtm https://codereview.chromium.org/68973005/diff/660001/include/core/SkBitmap.h File include/core/SkBitmap.h (right): https://codereview.chromium.org/68973005/diff/660001/include/core/SkBitmap.h#newcode240 include/core/SkBitmap.h:240: static bool Config2ColorType(Config, SkColorType*); Seems like this guy ...
7 years ago (2013-12-05 17:43:03 UTC) #21
reed1
https://codereview.chromium.org/68973005/diff/660001/include/core/SkBitmap.h File include/core/SkBitmap.h (right): https://codereview.chromium.org/68973005/diff/660001/include/core/SkBitmap.h#newcode240 include/core/SkBitmap.h:240: static bool Config2ColorType(Config, SkColorType*); On 2013/12/05 17:43:04, mtklein wrote: ...
7 years ago (2013-12-05 18:44:13 UTC) #22
reed1
ptal -- known work-around that I will address -- SkImageRef needs to update its constructor ...
7 years ago (2013-12-05 22:13:41 UTC) #23
mtklein
still lgtm https://codereview.chromium.org/68973005/diff/720001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/68973005/diff/720001/src/core/SkBitmap.cpp#newcode540 src/core/SkBitmap.cpp:540: ctable); ctable looks so lonely on this ...
7 years ago (2013-12-06 14:44:34 UTC) #24
scroggo
https://codereview.chromium.org/68973005/diff/720001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/720001/include/core/SkImageInfo.h#newcode139 include/core/SkImageInfo.h:139: fWidth * SkColorTypeBytesPerPixel(fColorType); Should this call bytesPerPixel? https://codereview.chromium.org/68973005/diff/720001/include/core/SkMallocPixelRef.h File ...
7 years ago (2013-12-06 14:50:32 UTC) #25
reed1
https://codereview.chromium.org/68973005/diff/720001/include/core/SkImageInfo.h File include/core/SkImageInfo.h (right): https://codereview.chromium.org/68973005/diff/720001/include/core/SkImageInfo.h#newcode139 include/core/SkImageInfo.h:139: fWidth * SkColorTypeBytesPerPixel(fColorType); On 2013/12/06 14:50:33, scroggo wrote: > ...
7 years ago (2013-12-06 15:48:45 UTC) #26
scroggo
lgtm at patch set 17 https://codereview.chromium.org/68973005/diff/720001/include/core/SkMallocPixelRef.h File include/core/SkMallocPixelRef.h (right): https://codereview.chromium.org/68973005/diff/720001/include/core/SkMallocPixelRef.h#newcode54 include/core/SkMallocPixelRef.h:54: virtual size_t getAllocatedSizeInBytes() const ...
7 years ago (2013-12-06 15:55:19 UTC) #27
reed1
7 years ago (2013-12-06 18:41:52 UTC) #28
Message was sent while issue was closed.
Committed patchset #20 manually as r12537 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698