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

Issue 863053002: new API for retrieving YUV data (Closed)

Created:
5 years, 11 months ago by reed1
Modified:
4 years, 9 months ago
CC:
reviews_skia.org, rileya1, hal.canary
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

new API for retrieving YUV data BUG=skia:

Patch Set 1 #

Total comments: 4

Patch Set 2 : update dox #

Patch Set 3 : add fall-back impl and add build-flag #

Patch Set 4 : ripple API change to SkPixelRef -- still need to tackle decoders" #

Total comments: 11

Patch Set 5 : update dox #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -40 lines) Patch
M include/core/SkImageGenerator.h View 1 2 3 4 4 chunks +41 lines, -0 lines 0 comments Download
M include/core/SkPixelRef.h View 1 2 3 3 chunks +48 lines, -2 lines 0 comments Download
M src/core/SkImageGenerator.cpp View 1 2 3 chunks +74 lines, -11 lines 0 comments Download
M src/core/SkPixelRef.cpp View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M src/gpu/SkGr.cpp View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M src/images/SkDecodingImageGenerator.cpp View 1 2 3 3 chunks +20 lines, -8 lines 0 comments Download
M src/lazy/SkDiscardablePixelRef.h View 1 2 3 1 chunk +7 lines, -5 lines 0 comments Download
M src/ports/SkImageGenerator_skia.cpp View 1 2 3 1 chunk +7 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
reed1
just want to converge on the API semantics/naming first.
5 years, 11 months ago (2015-01-21 22:20:46 UTC) #2
sugoi1
https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h#newcode132 include/core/SkImageGenerator.h:132: * If this returns false, the value of the ...
5 years, 11 months ago (2015-01-22 15:01:37 UTC) #4
reed1
https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h#newcode132 include/core/SkImageGenerator.h:132: * If this returns false, the value of the ...
5 years, 11 months ago (2015-01-22 16:01:36 UTC) #5
reed1
Leon, seems like we need to coordinate w/ your plans for future Decoder API changes ...
5 years, 11 months ago (2015-01-22 17:01:05 UTC) #7
scroggo
https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h#newcode138 include/core/SkImageGenerator.h:138: bool queryYUV8(SkISize logicalSizes[3], SkISize optimalAllocationSizes[3]); It's interesting to me ...
5 years, 11 months ago (2015-01-22 19:47:47 UTC) #8
scroggo
On 2015/01/22 17:01:05, reed1 wrote: > Leon, seems like we need to coordinate w/ your ...
5 years, 11 months ago (2015-01-27 18:35:49 UTC) #9
reed1
https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h#newcode138 include/core/SkImageGenerator.h:138: bool queryYUV8(SkISize logicalSizes[3], SkISize optimalAllocationSizes[3]); On 2015/01/22 19:47:47, scroggo ...
5 years, 11 months ago (2015-01-27 18:42:40 UTC) #10
reed1
https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/1/include/core/SkImageGenerator.h#newcode132 include/core/SkImageGenerator.h:132: * If this returns false, the value of the ...
5 years, 11 months ago (2015-01-27 18:44:04 UTC) #11
scroggo
https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h File include/core/SkImageGenerator.h (right): https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h#newcode155 include/core/SkImageGenerator.h:155: bool getYUV8(const SkISize allocationSizes[3], void* planes[3], SkYUVColorSpace* colorSpace); On ...
5 years, 11 months ago (2015-01-27 18:59:18 UTC) #12
sugoi1
On 2015/01/27 18:59:18, scroggo wrote: > https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h > File include/core/SkImageGenerator.h (right): > > https://codereview.chromium.org/863053002/diff/60001/include/core/SkImageGenerator.h#newcode155 > ...
5 years, 10 months ago (2015-02-04 19:04:18 UTC) #13
reed1
Gotcha. 1. I think we should try to land a version of this CL, as ...
5 years, 10 months ago (2015-02-04 19:22:17 UTC) #14
sugoi1
On 2015/02/04 19:22:17, reed1 wrote: > Gotcha. > > 1. I think we should try ...
5 years, 10 months ago (2015-02-04 19:36:00 UTC) #15
scroggo
5 years, 10 months ago (2015-02-09 20:08:53 UTC) #16
On 2015/02/04 19:22:17, reed1 wrote:
> Gotcha.
> 
> 1. I think we should try to land a version of this CL, as it clarifies the
> existing protocol.
> 
> 2. Lets think about how to expose to Generators the ability to return their
data
> already-in-hand... Or maybe they're not a generate as much as a bitmap itself.
I
> think one tricky part either way is life-time management: how long is the
client
> allowed to treat that memory as valid? (e.g. can I embed those ptrs in a
> picture?)

IIUC, the motivation behind an SkImageGenerator is to be an abstraction for
regenerating in the case where the client had thrown away the generated image.
In the case of returning a bitmap or memory supplied by the generator, does it
still make sense to be an SkImageGenerator? Or is there some other abstraction
that makes more sense? (If it should *not* be an SkImageGenerator, we need to
rethink merging SkCodec and SkImageGenerator (as suggested in
https://codereview.chromium.org/822083002/).)

As for how long the memory is valid, I would say as long as the SkImageGenerator
(or other abstraction) is still around. So if you used
SkImage::NewFromGenerator, which returns a new SkImage that holds on to the
SkImageGenerator, there should not be any problems. When drawing to an
SkPicture, I assume drawImage stores a reference to the SkImage, so that should
be fine, too. I would say that embedding those pointers directly into an
SkPicture (or hanging on to them directly in general) would be a bad idea.

Powered by Google App Engine
This is Rietveld 408576698