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

Issue 105773003: Teach Skia to use discardable memory (Closed)

Created:
7 years ago by Alpha Left Google
Modified:
7 years ago
CC:
blink-reviews, jamesr, krit, dsinclair, danakj, Rik, Stephen Chennney, pdr., rwlbuis, reveman
Visibility:
Public.

Description

Teach Skia to use discardable memory Using discardable memory in Skia requires the following changes: 1. Use of SkDiscardablePixelRef. 2. Implementation of SkImageGenerator to decode an image. This change implements items above by reusing existing infrastructure in ImageFrameGenerator and DeferredImageDecoder. ImageFrameGenerator performs the actual decoding. DeferredImageDecoder is responsible for generating SkBitmap backed by SkDiscardablePixelRef. There are some limitations of this implementations: 1. Decoder does not write directly to the memory provided by Skia. memcpy() is required. 2. Decoding allocates heap memory as output buffer. 3. ImageDecodingStore is still in use and manages a pool of cache. Since the deferred image decoding is still used by Android the two code paths will coexist until the transition is complete. Upcoming changes will loosen up the above limitations. BUG=318490 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163743

Patch Set 1 #

Total comments: 6

Patch Set 2 : nits #

Patch Set 3 : merged #

Patch Set 4 : merged #

Patch Set 5 : merged and discardable #

Patch Set 6 : merged and label #

Patch Set 7 : merged and discardable #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -33 lines) Patch
Source/platform/blink_platform.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A + Source/platform/graphics/DecodingImageGenerator.h View 1 2 1 chunk +25 lines, -30 lines 0 comments Download
A Source/platform/graphics/DecodingImageGenerator.cpp View 1 2 1 chunk +81 lines, -0 lines 0 comments Download
M Source/platform/graphics/DeferredImageDecoder.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M Source/platform/graphics/DeferredImageDecoder.cpp View 1 2 3 4 6 chunks +44 lines, -3 lines 1 comment Download
M Source/platform/graphics/ImageFrameGenerator.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M Source/platform/graphics/ImageFrameGenerator.cpp View 1 2 1 chunk +32 lines, -0 lines 0 comments Download
M Source/web/tests/DeferredImageDecoderTest.cpp View 1 2 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Alpha Left Google
7 years ago (2013-12-05 00:16:33 UTC) #1
Alpha Left Google
Review ping.
7 years ago (2013-12-05 19:50:35 UTC) #2
Stephen White
LGTM; my comments are just nits https://codereview.chromium.org/105773003/diff/1/Source/core/platform/graphics/DecodingImageGenerator.cpp File Source/core/platform/graphics/DecodingImageGenerator.cpp (right): https://codereview.chromium.org/105773003/diff/1/Source/core/platform/graphics/DecodingImageGenerator.cpp#newcode57 Source/core/platform/graphics/DecodingImageGenerator.cpp:57: SkData* skdata = ...
7 years ago (2013-12-05 21:52:13 UTC) #3
Alpha Left Google
https://codereview.chromium.org/105773003/diff/1/Source/core/platform/graphics/DecodingImageGenerator.cpp File Source/core/platform/graphics/DecodingImageGenerator.cpp (right): https://codereview.chromium.org/105773003/diff/1/Source/core/platform/graphics/DecodingImageGenerator.cpp#newcode57 Source/core/platform/graphics/DecodingImageGenerator.cpp:57: SkData* skdata = SkData::NewWithCopy(buffer->data(), buffer->size()); On 2013/12/05 21:52:14, Stephen ...
7 years ago (2013-12-08 00:30:11 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/105773003/20001
7 years ago (2013-12-08 00:32:46 UTC) #5
commit-bot: I haz the power
Failed to apply patch for Source/core/platform/graphics/DecodingImageGenerator.h: While running svn copy Source/core/platform/graphics/test/MockDiscardablePixelRef.h Source/core/platform/graphics/DecodingImageGenerator.h --config-dir /b/commit-queue/subversion_config --non-interactive ...
7 years ago (2013-12-08 00:32:50 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/105773003/40001
7 years ago (2013-12-08 00:57:17 UTC) #7
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=12477
7 years ago (2013-12-08 01:11:25 UTC) #8
Alpha Left Google
+jamesr for owners approval for Source/web/tests.
7 years ago (2013-12-09 20:55:17 UTC) #9
jamesr
tests lgtm, but you really should move these into Source/platform/graphics
7 years ago (2013-12-09 21:20:25 UTC) #10
Alpha Left Google
On 2013/12/09 21:20:25, jamesr wrote: > tests lgtm, but you really should move these into ...
7 years ago (2013-12-09 21:24:20 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/105773003/40001
7 years ago (2013-12-09 21:25:14 UTC) #12
jamesr
Huh? Why? Unit tests should live next to the code under tests.
7 years ago (2013-12-09 21:26:37 UTC) #13
Alpha Left Google
On 2013/12/09 21:26:37, jamesr wrote: > Huh? Why? Unit tests should live next to the ...
7 years ago (2013-12-09 21:28:34 UTC) #14
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=12555
7 years ago (2013-12-09 23:07:38 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/105773003/60001
7 years ago (2013-12-10 00:18:29 UTC) #16
commit-bot: I haz the power
Retried try job too often on linux_blink for step(s) blink_platform_unittests, webkit_unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink&number=5002
7 years ago (2013-12-10 02:44:07 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/105773003/110001
7 years ago (2013-12-12 00:40:51 UTC) #18
commit-bot: I haz the power
Change committed as 163743
7 years ago (2013-12-12 02:27:49 UTC) #19
johnme
A revert of this CL has been created in https://codereview.chromium.org/105003005/ by johnme@chromium.org. The reason for ...
7 years ago (2013-12-12 11:31:55 UTC) #20
reveman
https://codereview.chromium.org/105773003/diff/110001/Source/platform/graphics/DeferredImageDecoder.cpp File Source/platform/graphics/DeferredImageDecoder.cpp (right): https://codereview.chromium.org/105773003/diff/110001/Source/platform/graphics/DeferredImageDecoder.cpp#newcode47 Source/platform/graphics/DeferredImageDecoder.cpp:47: bool DeferredImageDecoder::s_skiaDiscardableMemoryEnabled = false; Can we just make this ...
7 years ago (2013-12-12 16:57:10 UTC) #21
Alpha Left Google
7 years ago (2013-12-12 19:22:30 UTC) #22
Message was sent while issue was closed.
On 2013/12/12 16:57:10, David Reveman wrote:
>
https://codereview.chromium.org/105773003/diff/110001/Source/platform/graphic...
> File Source/platform/graphics/DeferredImageDecoder.cpp (right):
> 
>
https://codereview.chromium.org/105773003/diff/110001/Source/platform/graphic...
> Source/platform/graphics/DeferredImageDecoder.cpp:47: bool
> DeferredImageDecoder::s_skiaDiscardableMemoryEnabled = false;
> Can we just make this true if !defined(OS_ANDROID) for now. I don't think a
> setting is necessary as we should make this default on all platforms asap.

Okay. That's easy to do. I'll upload another patch.

Powered by Google App Engine
This is Rietveld 408576698