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

Issue 83563002: Implement SkAshmemDiscardableMemory (Closed)

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

Description

Implement SkAshmemDiscardableMemory - Implement ashmem-backed SkDiscardableMemory subclass: This class in only accesible via the SkDiscardableMemory::Create() function, which replaces the mock implementation in SkDiscardableMemory_none.cpp - Added SkDiscardableMemory_ashmem.cpp to the Android port of Skia Removed SkDiscardableMemory_none.cpp from the Android port. - Added DiscardableMemoryTest. Still needs work. - SkDiscardablePixelRef Bugfix: onLockPixels() now calls SkDELETE on the SkDiscardableMemory pointer when it fails to unlock. - Improved documentation inside ashmem.h BUG= R=scroggo@google.com Committed: https://code.google.com/p/skia/source/detail?r=12608

Patch Set 1 #

Patch Set 2 : bugfix #

Total comments: 19

Patch Set 3 : fixes from scroggo #

Total comments: 2

Patch Set 4 : unstatic #

Patch Set 5 : rebase #

Patch Set 6 : FLAGS_useVolatileCache #

Patch Set 7 : remove extra locking #

Patch Set 8 : final rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -5 lines) Patch
M gyp/ports.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/tests.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A src/ports/SkDiscardableMemory_ashmem.cpp View 1 2 3 4 5 6 1 chunk +114 lines, -0 lines 0 comments Download
M src/utils/android/ashmem.h View 1 chunk +6 lines, -0 lines 0 comments Download
M tests/CachedDecodingPixelRefTest.cpp View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
A tests/DiscardableMemoryTest.cpp View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
M tools/LazyDecodeBitmap.cpp View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
hal.canary
7 years, 1 month ago (2013-11-22 14:02:55 UTC) #1
scroggo
https://codereview.chromium.org/83563002/diff/2/gyp/ports.gyp File gyp/ports.gyp (right): https://codereview.chromium.org/83563002/diff/2/gyp/ports.gyp#newcode157 gyp/ports.gyp:157: '../src/ports/SkDiscardableMemory_none.cpp', nit: not in alphabetical order. https://codereview.chromium.org/83563002/diff/2/gyp/ports.gyp#newcode160 gyp/ports.gyp:160: '../src/ports/SkDiscardableMemory_ashmem.cpp', ...
7 years, 1 month ago (2013-11-22 14:34:14 UTC) #2
hal.canary
https://codereview.chromium.org/83563002/diff/2/gyp/ports.gyp File gyp/ports.gyp (right): https://codereview.chromium.org/83563002/diff/2/gyp/ports.gyp#newcode157 gyp/ports.gyp:157: '../src/ports/SkDiscardableMemory_none.cpp', On 2013/11/22 14:34:14, scroggo wrote: > nit: not ...
7 years, 1 month ago (2013-11-22 15:17:54 UTC) #3
scroggo
https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp File src/ports/SkDiscardableMemory_ashmem.cpp (right): https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp#newcode108 src/ports/SkDiscardableMemory_ashmem.cpp:108: if (-1 == ashmem_pin_region(fd, 0, 0)) { On 2013/11/22 ...
7 years, 1 month ago (2013-11-22 15:37:05 UTC) #4
hal.canary
https://codereview.chromium.org/83563002/diff/130001/tests/DiscardableMemoryTest.cpp File tests/DiscardableMemoryTest.cpp (right): https://codereview.chromium.org/83563002/diff/130001/tests/DiscardableMemoryTest.cpp#newcode14 tests/DiscardableMemoryTest.cpp:14: static const char testString[] = "HELLO, WORLD!"; On 2013/11/22 ...
7 years, 1 month ago (2013-11-22 16:37:26 UTC) #5
hal.canary
PTAL
7 years ago (2013-12-05 22:17:30 UTC) #6
reed1
I think you can close the FD as soon as you create the mmap
7 years ago (2013-12-06 15:09:46 UTC) #7
scroggo
https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp File src/ports/SkDiscardableMemory_ashmem.cpp (right): https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp#newcode108 src/ports/SkDiscardableMemory_ashmem.cpp:108: if (-1 == ashmem_pin_region(fd, 0, 0)) { On 2013/11/22 ...
7 years ago (2013-12-06 16:07:50 UTC) #8
hal.canary
https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp File src/ports/SkDiscardableMemory_ashmem.cpp (right): https://codereview.chromium.org/83563002/diff/2/src/ports/SkDiscardableMemory_ashmem.cpp#newcode108 src/ports/SkDiscardableMemory_ashmem.cpp:108: if (-1 == ashmem_pin_region(fd, 0, 0)) { On 2013/12/06 ...
7 years ago (2013-12-06 20:14:41 UTC) #9
scroggo
lgtm
7 years ago (2013-12-09 20:39:36 UTC) #10
hal.canary
7 years ago (2013-12-10 18:33:14 UTC) #11
Message was sent while issue was closed.
Committed patchset #8 manually as r12608 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698