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

Issue 312353003: Initial KTX encoder (Closed)

Created:
6 years, 6 months ago by krajcevski
Modified:
6 years, 6 months ago
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Initial KTX encoder The encoder comes with tests to check that the encoding/decoding operations between ETC encoded bitmaps and ARGB bitmaps are sane. Committed: https://skia.googlesource.com/skia/+/c250d2e4abdbe8193357696518592af8a0b4555a

Patch Set 1 #

Total comments: 24

Patch Set 2 : Code review changes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+536 lines, -9 lines) Patch
M gyp/ktx.gyp View 1 chunk +2 lines, -1 line 0 comments Download
M gyp/tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageEncoder.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/images/SkImageDecoder_ktx.cpp View 1 6 chunks +86 lines, -3 lines 2 comments Download
A tests/KtxTest.cpp View 1 1 chunk +168 lines, -0 lines 0 comments Download
M third_party/ktx/ktx.h View 1 4 chunks +18 lines, -3 lines 0 comments Download
M third_party/ktx/ktx.cpp View 1 5 chunks +259 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
krajcevski
6 years, 6 months ago (2014-06-05 18:38:07 UTC) #1
robertphillips
lgtm + nits https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp File src/images/SkImageDecoder_ktx.cpp (right): https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp#newcode141 src/images/SkImageDecoder_ktx.cpp:141: bool setRequireUnpremul = false; Can we ...
6 years, 6 months ago (2014-06-05 19:12:22 UTC) #2
krajcevski
https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp File src/images/SkImageDecoder_ktx.cpp (right): https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp#newcode141 src/images/SkImageDecoder_ktx.cpp:141: bool setRequireUnpremul = false; On 2014/06/05 19:12:19, robertphillips wrote: ...
6 years, 6 months ago (2014-06-05 19:29:45 UTC) #3
bsalomon
On 2014/06/05 19:29:45, krajcevski wrote: > https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp > File src/images/SkImageDecoder_ktx.cpp (right): > > https://codereview.chromium.org/312353003/diff/1/src/images/SkImageDecoder_ktx.cpp#newcode141 > ...
6 years, 6 months ago (2014-06-05 20:36:21 UTC) #4
krajcevski
The CQ bit was checked by krajcevski@google.com
6 years, 6 months ago (2014-06-05 20:40:01 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/krajcevski@google.com/312353003/20001
6 years, 6 months ago (2014-06-05 20:41:04 UTC) #6
commit-bot: I haz the power
Change committed as c250d2e4abdbe8193357696518592af8a0b4555a
6 years, 6 months ago (2014-06-06 13:16:32 UTC) #7
scroggo
https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecoder_ktx.cpp File src/images/SkImageDecoder_ktx.cpp (right): https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecoder_ktx.cpp#newcode144 src/images/SkImageDecoder_ktx.cpp:144: this->setRequireUnpremultipliedColors(true); This is intended as a setting for the ...
6 years, 6 months ago (2014-06-09 14:49:45 UTC) #8
krajcevski
On 2014/06/09 14:49:45, scroggo wrote: > https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecoder_ktx.cpp > File src/images/SkImageDecoder_ktx.cpp (right): > > https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecoder_ktx.cpp#newcode144 > ...
6 years, 6 months ago (2014-06-09 17:23:45 UTC) #9
scroggo
6 years, 6 months ago (2014-06-09 18:01:15 UTC) #10
Message was sent while issue was closed.
On 2014/06/09 17:23:45, krajcevski wrote:
> On 2014/06/09 14:49:45, scroggo wrote:
> >
>
https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecode...
> > File src/images/SkImageDecoder_ktx.cpp (right):
> > 
> >
>
https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecode...
> > src/images/SkImageDecoder_ktx.cpp:144:
> > this->setRequireUnpremultipliedColors(true);
> > This is intended as a setting for the client. If the client actually wanted
> > unpremultiplied colors, this will incorrectly give them premultiplied
colors.
> > 
> >
>
https://codereview.chromium.org/312353003/diff/20001/src/images/SkImageDecode...
> > src/images/SkImageDecoder_ktx.cpp:165:
> > this->setRequireUnpremultipliedColors(false);
> > Again, if the client wanted unpremultiplied colors, this would change the
> > behavior for followup calls.
> > 
> > (FWIW, our main client of SkImageDecoder, Android, does not reuse a
decoder.)
> 
> What is the intended behavior if a bitmap contains premultiplied alpha on
disk,
> but the client asks for unpremultiplied alpha.

Get unpremultiplied data (SkImageDecoder_CG.cpp does this) or NULL (in some
cases we return NULL
if we cannot/choose not to honor the request).

> Does the sampler need an
> additional setting that unpremultiplies the color components?

That would make sense. Currently it just looks the SkImageDecoder, since we
previously
did not have a case where the encoded data was already premultiplied. I do think
it
makes sense to use the same path inside the sampler, but we just need to make
sure
we don't interfere with the intent of setRequireUnpremultipliedColors.

Powered by Google App Engine
This is Rietveld 408576698