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

Issue 106883006: Add a release procedure to SkMallocPixelRef; remove SkDataPixelRef (Closed)

Created:
6 years, 11 months ago by hal.canary
Modified:
6 years, 11 months ago
Reviewers:
reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Add a release procedure to SkMallocPixelRef; remove SkDataPixelRef This works in a way that is similar to SkData. SkMallocPixelRef::NewWithProc Motivation: Chrome has a ETC1PixelRef which calls delete[] on the pixles on destruction. There is no reason for them to almost duplicate our class, when we can provide them a more flexible class. Example use: static void delete_uint8_proc(void* ptr, void*) { delete[] static_cast<uint8_t>(ptr); } SkPixelRef* new_delete_pixref(const SkImageInfo& info, SkColorTable* ctable) { size_t rb = info.minRowBytes(); return SkMallocPixelRef::NewWithProc( info, rb, ctable, new uint8_t[info.getSafeSize(rb)], delete_uint8_proc, NULL); } SkMallocPixelRef::NewWithData Motivation: This allows up to eliminate SkDataPixelRef. We modified SkImage_Raster to use MallocPixelRef rather than SkDataPixlRef. Also: Unit tests in tests/MallocPixelRefTest. BUG= R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=12861

Patch Set 1 #

Patch Set 2 : lint #

Patch Set 3 : rebase #

Patch Set 4 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -92 lines) Patch
M gyp/core.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M gyp/tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkMallocPixelRef.h View 2 chunks +40 lines, -1 line 0 comments Download
M src/core/SkMallocPixelRef.cpp View 1 2 6 chunks +85 lines, -6 lines 0 comments Download
D src/image/SkDataPixelRef.h View 1 chunk +0 lines, -36 lines 0 comments Download
D src/image/SkDataPixelRef.cpp View 1 chunk +0 lines, -46 lines 0 comments Download
M src/image/SkImage_Raster.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
A tests/MallocPixelRefTest.cpp View 1 1 chunk +116 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hal.canary
ptal; is this worth doing?
6 years, 11 months ago (2013-12-30 14:06:47 UTC) #1
reed1
lgtm
6 years, 11 months ago (2013-12-30 16:18:48 UTC) #2
hal.canary
6 years, 11 months ago (2014-01-02 17:29:36 UTC) #3
Message was sent while issue was closed.
Committed patchset #4 manually as r12861 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698