Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(300)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 7346044: Added support for non-separable blending modes

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by RikC
Modified:
12 years, 10 months ago
Reviewers:
Steve VanDeBogart , Stephen White, senorblanco, caryclark1;reed, bungeman, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.
Added support for non-separable blending modes

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Created: 12 years, 10 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -7 lines) Patch
M gm/xfermodes.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
M include/core/SkXfermode.h View 1 2 chunks +9 lines, -5 lines 0 comments Download
M src/core/SkXfermode.cpp View 1 2 3 4 5 3 chunks +234 lines, -0 lines 0 comments Download
M src/pdf/SkPDFGraphicState.cpp View 1 2 3 4 3 chunks +7 lines, -2 lines 0 comments Download
Total messages: 44
|
reed1
https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h File include/core/SkXfermode.h (right): https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h#newcode122 include/core/SkXfermode.h:122: I don't see these documented on http://www.w3.org/TR/2009/WD-SVGCompositing-20090430. Can you ...
12 years, 10 months ago (2013年02月20日 17:56:02 UTC) #1
https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h
File include/core/SkXfermode.h (right):
https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h#newco...
include/core/SkXfermode.h:122: 
I don't see these documented on
http://www.w3.org/TR/2009/WD-SVGCompositing-20090430. Can you add comments to
point to the spec?
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp
File src/core/SkXfermode.cpp (right):
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434
src/core/SkXfermode.cpp:434: // the non-separable blend modes rely on the
following formulas:
const int parameter is a construct we never use in skia. int parameter is
sufficient.
Must we use exactly this conversion of RGB -> Luminance? There are other
approximations that don't involve an int divide.
A more descriptive name? rgb_to_luminance?
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode446
src/core/SkXfermode.cpp:446: 
Skia uses int* for var arguments, and only uses & when the parameter is const.
e.g. const Foo&
's' is int here, but a float in the caller...?
I don't understand how "saturation" fits into this helper function. Is this
implementing some form of lerp?
Sign in to reply to this message.
Steve VanDeBogart
These modes are directly supported by PDF, please add entries to blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
12 years, 10 months ago (2013年02月20日 18:11:37 UTC) #2
These modes are directly supported by PDF, please add entries to 
blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
Sign in to reply to this message.
RikC
On 2013年02月20日 18:11:37, Steve VanDeBogart wrote: > These modes are directly supported by PDF, please ...
12 years, 10 months ago (2013年02月20日 18:20:32 UTC) #3
On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> These modes are directly supported by PDF, please add entries to 
> blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
Will do
Sign in to reply to this message.
RikC
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp File src/core/SkXfermode.cpp (right): https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434 src/core/SkXfermode.cpp:434: // the non-separable blend modes rely on the following ...
12 years, 10 months ago (2013年02月20日 18:20:42 UTC) #4
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp
File src/core/SkXfermode.cpp (right):
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434
src/core/SkXfermode.cpp:434: // the non-separable blend modes rely on the
following formulas:
On 2013年02月20日 17:56:02, reed1 wrote:
> const int parameter is a construct we never use in skia. int parameter is
> sufficient.
> 
> Must we use exactly this conversion of RGB -> Luminance? There are other
> approximations that don't involve an int divide.
Do you have a pointer to those?
> 
> A more descriptive name? rgb_to_luminance?
I prefer to keep the name since it matches the spec (and other implementations)
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode446
src/core/SkXfermode.cpp:446: 
On 2013年02月20日 17:56:02, reed1 wrote:
> Skia uses int* for var arguments, and only uses & when the parameter is const.
> e.g. const Foo&
> 
> 's' is int here, but a float in the caller...?
> 
I will fix this.
> I don't understand how "saturation" fits into this helper function. Is this
> implementing some form of lerp?
No, it's not like lerp.
I'm unsure how the formula is derived; this is how it's defined in the pdf
reference manual
Sign in to reply to this message.
reed1
On 2013年02月20日 18:20:42, RikC wrote: > https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp > File src/core/SkXfermode.cpp (right): > > https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434 > ...
12 years, 10 months ago (2013年02月20日 18:26:41 UTC) #5
On 2013年02月20日 18:20:42, RikC wrote:
> https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp
> File src/core/SkXfermode.cpp (right):
> 
>
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434
> src/core/SkXfermode.cpp:434: // the non-separable blend modes rely on the
> following formulas:
> On 2013年02月20日 17:56:02, reed1 wrote:
> > const int parameter is a construct we never use in skia. int parameter is
> > sufficient.
> > 
> > Must we use exactly this conversion of RGB -> Luminance? There are other
> > approximations that don't involve an int divide.
> 
> Do you have a pointer to those?
> 
> > 
> > A more descriptive name? rgb_to_luminance?
> 
> I prefer to keep the name since it matches the spec (and other
implementations)
Then perhaps we can group these, perhaps via a common prefix/suffix so they are
clearly all part of a set of PDF-specific helper functions. Perhaps we move all
of this new support code into a separate .cpp (e.g. SkXfermodes_something.cpp),
since the current file is getter awfully big anyway.
> 
>
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode446
> src/core/SkXfermode.cpp:446: 
> On 2013年02月20日 17:56:02, reed1 wrote:
> > Skia uses int* for var arguments, and only uses & when the parameter is
const.
> > e.g. const Foo&
> > 
> > 's' is int here, but a float in the caller...?
> > 
> 
> I will fix this.
> 
> > I don't understand how "saturation" fits into this helper function. Is this
> > implementing some form of lerp?
> No, it's not like lerp.
> I'm unsure how the formula is derived; this is how it's defined in the pdf
> reference manual
OK. Lets add a comment stating that, so the next reader/maintainer knows where
to look to understand that function.
Sign in to reply to this message.
reed1
include/core/SkColorPriv.h SkComputeLuminance(r, g, b)
12 years, 10 months ago (2013年02月20日 18:30:11 UTC) #6
include/core/SkColorPriv.h
SkComputeLuminance(r, g, b)
Sign in to reply to this message.
RikC
Added missing blend modes. Also, fixed the multiply blend mode. It was incorrectly using modulate ...
12 years, 10 months ago (2013年02月20日 19:42:47 UTC) #7
Added missing blend modes.
Also, fixed the multiply blend mode. It was incorrectly using modulate
https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h
File include/core/SkXfermode.h (right):
https://codereview.appspot.com/7346044/diff/1/include/core/SkXfermode.h#newco...
include/core/SkXfermode.h:122: 
On 2013年02月20日 17:56:02, reed1 wrote:
> I don't see these documented on
> http://www.w3.org/TR/2009/WD-SVGCompositing-20090430. Can you add comments to
> point to the spec?
Done.
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp
File src/core/SkXfermode.cpp (right):
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode434
src/core/SkXfermode.cpp:434: // the non-separable blend modes rely on the
following formulas:
On 2013年02月20日 17:56:02, reed1 wrote:
> const int parameter is a construct we never use in skia. int parameter is
> sufficient.
> 
> Must we use exactly this conversion of RGB -> Luminance? There are other
> approximations that don't involve an int divide.
> 
> A more descriptive name? rgb_to_luminance?
Done.
https://codereview.appspot.com/7346044/diff/1/src/core/SkXfermode.cpp#newcode446
src/core/SkXfermode.cpp:446: 
On 2013年02月20日 18:20:42, RikC wrote:
> On 2013年02月20日 17:56:02, reed1 wrote:
> > Skia uses int* for var arguments, and only uses & when the parameter is
const.
> > e.g. const Foo&
> > 
> > 's' is int here, but a float in the caller...?
> > 
> 
> I will fix this.
> 
> > I don't understand how "saturation" fits into this helper function. Is this
> > implementing some form of lerp?
> No, it's not like lerp.
> I'm unsure how the formula is derived; this is how it's defined in the pdf
> reference manual
> 
Done.
Sign in to reply to this message.
RikC
On 2013年02月20日 18:11:37, Steve VanDeBogart wrote: > These modes are directly supported by PDF, please ...
12 years, 10 months ago (2013年02月20日 19:58:24 UTC) #8
On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> These modes are directly supported by PDF, please add entries to 
> blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
Is there a location where this is used to render PDFs?
Sign in to reply to this message.
Steve VanDeBogart
On 2013年02月20日 19:58:24, RikC wrote: > On 2013年02月20日 18:11:37, Steve VanDeBogart wrote: > > These ...
12 years, 10 months ago (2013年02月20日 20:18:53 UTC) #9
On 2013年02月20日 19:58:24, RikC wrote:
> On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> > These modes are directly supported by PDF, please add entries to 
> > blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
> 
> Is there a location where this is used to render PDFs?
I'm sorry, I'm not sure what you mean. The gm you modified should generate pdfs
unless you pass the --nopdf option.
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cp...
src/pdf/SkPDFGraphicState.cpp:49: case SkXfermode::kModulate_Mode:
If I understand correctly, Multiply and Modulate are pretty similar. It might
be better to do Multiply when Modulate is requested instead of doing nothing.
Sign in to reply to this message.
RikC
On 2013年02月20日 20:18:53, Steve VanDeBogart wrote: > On 2013年02月20日 19:58:24, RikC wrote: > > On ...
12 years, 10 months ago (2013年02月20日 20:33:33 UTC) #10
On 2013年02月20日 20:18:53, Steve VanDeBogart wrote:
> On 2013年02月20日 19:58:24, RikC wrote:
> > On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> > > These modes are directly supported by PDF, please add entries to 
> > > blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
> > 
> > Is there a location where this is used to render PDFs?
> 
> I'm sorry, I'm not sure what you mean. The gm you modified should generate
pdfs
> unless you pass the --nopdf option.
I was talking about the code that renders PDF files in Chrome. Does it use these
routines from Skia?
> 
> https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cpp
> File src/pdf/SkPDFGraphicState.cpp (right):
> 
>
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cp...
> src/pdf/SkPDFGraphicState.cpp:49: case SkXfermode::kModulate_Mode:
> If I understand correctly, Multiply and Modulate are pretty similar. It might
> be better to do Multiply when Modulate is requested instead of doing nothing.
I agree. Will do.
Sign in to reply to this message.
RikC
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp (right): https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cpp#newcode49 src/pdf/SkPDFGraphicState.cpp:49: case SkXfermode::kModulate_Mode: On 2013年02月20日 20:18:53, Steve VanDeBogart wrote: > ...
12 years, 10 months ago (2013年02月20日 20:43:49 UTC) #11
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):
https://codereview.appspot.com/7346044/diff/8001/src/pdf/SkPDFGraphicState.cp...
src/pdf/SkPDFGraphicState.cpp:49: case SkXfermode::kModulate_Mode:
On 2013年02月20日 20:18:53, Steve VanDeBogart wrote:
> If I understand correctly, Multiply and Modulate are pretty similar. It might
> be better to do Multiply when Modulate is requested instead of doing nothing.
Done.
Sign in to reply to this message.
Steve VanDeBogart
On 2013年02月20日 20:33:33, RikC wrote: > On 2013年02月20日 20:18:53, Steve VanDeBogart wrote: > > On ...
12 years, 10 months ago (2013年02月20日 21:06:17 UTC) #12
On 2013年02月20日 20:33:33, RikC wrote:
> On 2013年02月20日 20:18:53, Steve VanDeBogart wrote:
> > On 2013年02月20日 19:58:24, RikC wrote:
> > > On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> > > > These modes are directly supported by PDF, please add entries to 
> > > > blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
> > > 
> > > Is there a location where this is used to render PDFs?
> > 
> > I'm sorry, I'm not sure what you mean. The gm you modified should generate
> pdfs
> > unless you pass the --nopdf option.
> 
> I was talking about the code that renders PDF files in Chrome. Does it use
these
> routines from Skia?
Chrome print preview generates PDFs and that is done with Skia, yes. I'm not
sure if you can trigger any of these blend modes in a printing context from
Chrome, but if you can you should be able to see the result there.
Sign in to reply to this message.
RikC
On 2013年02月20日 21:06:17, Steve VanDeBogart wrote: > On 2013年02月20日 20:33:33, RikC wrote: > > On ...
12 years, 10 months ago (2013年02月20日 21:24:53 UTC) #13
On 2013年02月20日 21:06:17, Steve VanDeBogart wrote:
> On 2013年02月20日 20:33:33, RikC wrote:
> > On 2013年02月20日 20:18:53, Steve VanDeBogart wrote:
> > > On 2013年02月20日 19:58:24, RikC wrote:
> > > > On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> > > > > These modes are directly supported by PDF, please add entries to 
> > > > > blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
> > > > 
> > > > Is there a location where this is used to render PDFs?
> > > 
> > > I'm sorry, I'm not sure what you mean. The gm you modified should
generate
> > pdfs
> > > unless you pass the --nopdf option.
> > 
> > I was talking about the code that renders PDF files in Chrome. Does it use
> these
> > routines from Skia?
> 
> Chrome print preview generates PDFs and that is done with Skia, yes. I'm not
> sure if you can trigger any of these blend modes in a printing context from
> Chrome, but if you can you should be able to see the result there.
Chrome opens PDF files right in its window without the use of Acrobat. Is the
code that renders PDFs using Skia. If so, it seems that it should be extended
for these blend modes.
Sign in to reply to this message.
Steve VanDeBogart
On 2013年02月20日 21:24:53, RikC wrote: > On 2013年02月20日 21:06:17, Steve VanDeBogart wrote: > > On ...
12 years, 10 months ago (2013年02月20日 21:39:55 UTC) #14
On 2013年02月20日 21:24:53, RikC wrote:
> On 2013年02月20日 21:06:17, Steve VanDeBogart wrote:
> > On 2013年02月20日 20:33:33, RikC wrote:
> > > On 2013年02月20日 20:18:53, Steve VanDeBogart wrote:
> > > > On 2013年02月20日 19:58:24, RikC wrote:
> > > > > On 2013年02月20日 18:11:37, Steve VanDeBogart wrote:
> > > > > > These modes are directly supported by PDF, please add entries to 
> > > > > > blend_mode_from_xfermode() in src/pdf/SkPDFGraphicState.cpp
> > > > > 
> > > > > Is there a location where this is used to render PDFs?
> > > > 
> > > > I'm sorry, I'm not sure what you mean. The gm you modified should
> generate
> > > pdfs
> > > > unless you pass the --nopdf option.
> > > 
> > > I was talking about the code that renders PDF files in Chrome. Does it use
> > these
> > > routines from Skia?
> > 
> > Chrome print preview generates PDFs and that is done with Skia, yes. I'm
not
> > sure if you can trigger any of these blend modes in a printing context from
> > Chrome, but if you can you should be able to see the result there.
> 
> Chrome opens PDF files right in its window without the use of Acrobat. Is the
> code that renders PDFs using Skia. If so, it seems that it should be extended
> for these blend modes.
That code doesn't use Skia. The Skia PDF code only generates PDF, it doesn't
parse and render PDFs. If the blend modes don't show up in print preview, but
do if you save the PDF and view it in Acrobat, let me know and we can file a
Chrome bug for that.
Sign in to reply to this message.
RikC
Is there anything else that is needed for this patch?
12 years, 10 months ago (2013年02月22日 22:42:26 UTC) #15
Is there anything else that is needed for this patch?
Sign in to reply to this message.
Steve VanDeBogart
PDF code LGTM with nit https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp (right): https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.cpp#newcode17 src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode: nit: add ...
12 years, 10 months ago (2013年02月22日 22:54:56 UTC) #16
PDF code LGTM with nit
https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):
https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.c...
src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode:
nit: add a comment saying that one of these is wrong, but close enough.
Sign in to reply to this message.
RikC
On 2013年02月22日 22:54:56, Steve VanDeBogart wrote: > PDF code LGTM with nit > > https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.cpp ...
12 years, 10 months ago (2013年02月22日 23:06:19 UTC) #17
On 2013年02月22日 22:54:56, Steve VanDeBogart wrote:
> PDF code LGTM with nit
> 
>
https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.cpp
> File src/pdf/SkPDFGraphicState.cpp (right):
> 
>
https://codereview.appspot.com/7346044/diff/16001/src/pdf/SkPDFGraphicState.c...
> src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode:
> nit: add a comment saying that one of these is wrong, but close enough.
Done.
Sign in to reply to this message.
Steve VanDeBogart
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp (right): https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp#newcode17 src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode: // kModulate is not really like multipy ...
12 years, 10 months ago (2013年02月22日 23:10:25 UTC) #18
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.c...
src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode: // kModulate
is not really like multipy but similar most of the time.
Sorry, 100 col limit...
Sign in to reply to this message.
RikC
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp (right): https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp#newcode17 src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode: // kModulate is not really like multipy ...
12 years, 10 months ago (2013年02月22日 23:35:28 UTC) #19
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):
https://codereview.appspot.com/7346044/diff/19001/src/pdf/SkPDFGraphicState.c...
src/pdf/SkPDFGraphicState.cpp:17: case SkXfermode::kModulate_Mode: // kModulate
is not really like multipy but similar most of the time.
On 2013年02月22日 23:10:25, Steve VanDeBogart wrote:
> Sorry, 100 col limit...
Done.
Sign in to reply to this message.
Steve VanDeBogart
PDF code LGTM. reed1 is on EST, so you probably won't get a final ok ...
12 years, 10 months ago (2013年02月22日 23:38:41 UTC) #20
PDF code LGTM.
reed1 is on EST, so you probably won't get a final ok until tomorrow.
Sign in to reply to this message.
reed1
https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp File src/core/SkXfermode.cpp (right): https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp#newcode435 src/core/SkXfermode.cpp:435: // (See https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnonseparable) Why not call SkComputeLuminance?
12 years, 10 months ago (2013年02月25日 13:57:43 UTC) #21
reed1
Do we already have benchs that exercise each of the xfermodes? These new ones look ...
12 years, 10 months ago (2013年02月25日 13:58:53 UTC) #22
Do we already have benchs that exercise each of the xfermodes? These new ones
look complex enough that we may want to have such a bench(s) so we can
experiment with alternative impls.
Sign in to reply to this message.
RikC
https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp File src/core/SkXfermode.cpp (right): https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp#newcode435 src/core/SkXfermode.cpp:435: // (See https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnonseparable) On 2013年02月25日 13:57:43, reed1 wrote: > ...
12 years, 10 months ago (2013年02月25日 17:00:14 UTC) #23
https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp
File src/core/SkXfermode.cpp (right):
https://codereview.appspot.com/7346044/diff/22001/src/core/SkXfermode.cpp#new...
src/core/SkXfermode.cpp:435: // (See
https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnonsep...)
On 2013年02月25日 13:57:43, reed1 wrote:
> Why not call SkComputeLuminance?
That routine uses different values to multiply the components.
Sign in to reply to this message.
RikC
I'm unsure about that. is that a benchmark suite that skia runs? gm/xfermodes.cpp <https://codereview.appspot.com/7346044/patch/22001/16002> exercises ...
12 years, 10 months ago (2013年02月25日 17:01:13 UTC) #24
I'm unsure about that. is that a benchmark suite that skia runs?
gm/xfermodes.cpp
<https://codereview.appspot.com/7346044/patch/22001/16002> exercises
each blend mode.
Rik
On Mon, Feb 25, 2013 at 5:58 AM, <reed@google.com> wrote:
> Do we already have benchs that exercise each of the xfermodes? These new
> ones look complex enough that we may want to have such a bench(s) so we
> can experiment with alternative impls.
>
>
https://codereview.appspot.**com/7346044/<https://codereview.appspot.com/7346...
>
Sign in to reply to this message.
reed1
The coefficients we use for Luminance are derived from http://www.itu.int/rec/R-REC-BT.709/ Our understanding is that these ...
12 years, 10 months ago (2013年02月25日 17:43:47 UTC) #25
The coefficients we use for Luminance are derived from
http://www.itu.int/rec/R-REC-BT.709/
Our understanding is that these are also referenced by CSS itself (adding Ben
for more details).
1. Is there a correct set of coefficients we should use throughout Skia?
2. If so, lets all use SkComputeLuminance, and (as needed) correct its
coefficients
3. If not, please add a comment above your Lum() local function documenting that
it differs from SkComputeLuminance, and why.
I guess we don't have an existing micro-bench for individual xfermodes. I will
work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
RikC
On 2013年02月25日 17:43:47, reed1 wrote: > The coefficients we use for Luminance are derived from ...
12 years, 10 months ago (2013年02月25日 18:33:00 UTC) #26
On 2013年02月25日 17:43:47, reed1 wrote:
> The coefficients we use for Luminance are derived from
> http://www.itu.int/rec/R-REC-BT.709/
> 
> Our understanding is that these are also referenced by CSS itself (adding Ben
> for more details).
> 
> 1. Is there a correct set of coefficients we should use throughout Skia?
The one that the blend modes are using, are derived from NTSC (see PDF reference
manual 1.7, section 6.2.1)
> 2. If so, lets all use SkComputeLuminance, and (as needed) correct its
> coefficients
> 3. If not, please add a comment above your Lum() local function documenting
that
> it differs from SkComputeLuminance, and why.
I'm unsure which one is 'better'. Will there ever be a case where css luminance
is expected to be the same as blending? (Where is that used?)
If yes, they should be the same.
> 
> I guess we don't have an existing micro-bench for individual xfermodes. I will
> work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
Stephen White
On 2013年02月25日 18:33:00, RikC wrote: > On 2013年02月25日 17:43:47, reed1 wrote: > > The coefficients ...
12 years, 10 months ago (2013年02月25日 18:39:48 UTC) #27
On 2013年02月25日 18:33:00, RikC wrote:
> On 2013年02月25日 17:43:47, reed1 wrote:
> > The coefficients we use for Luminance are derived from
> > http://www.itu.int/rec/R-REC-BT.709/
> > 
> > Our understanding is that these are also referenced by CSS itself (adding
Ben
> > for more details).
> > 
> > 1. Is there a correct set of coefficients we should use throughout Skia?
> 
> The one that the blend modes are using, are derived from NTSC (see PDF
reference
> manual 1.7, section 6.2.1)
Drive-by comment: IIRC, the YCbCr computation is different between NTSC SD (ITU
601) and NTSC HD (ITU 709). Strange but true.
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-vers...
> > 2. If so, lets all use SkComputeLuminance, and (as needed) correct its
> > coefficients
> > 3. If not, please add a comment above your Lum() local function documenting
> that
> > it differs from SkComputeLuminance, and why.
> 
> I'm unsure which one is 'better'. Will there ever be a case where css
luminance
> is expected to be the same as blending? (Where is that used?)
> If yes, they should be the same.
> 
> > 
> > I guess we don't have an existing micro-bench for individual xfermodes. I
will
> > work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
RikC
On 2013年02月25日 18:39:48, Stephen White wrote: > On 2013年02月25日 18:33:00, RikC wrote: > > On ...
12 years, 10 months ago (2013年02月25日 18:49:13 UTC) #28
On 2013年02月25日 18:39:48, Stephen White wrote:
> On 2013年02月25日 18:33:00, RikC wrote:
> > On 2013年02月25日 17:43:47, reed1 wrote:
> > > The coefficients we use for Luminance are derived from
> > > http://www.itu.int/rec/R-REC-BT.709/
> > > 
> > > Our understanding is that these are also referenced by CSS itself (adding
> Ben
> > > for more details).
> > > 
> > > 1. Is there a correct set of coefficients we should use throughout Skia?
> > 
> > The one that the blend modes are using, are derived from NTSC (see PDF
> reference
> > manual 1.7, section 6.2.1)
> 
> Drive-by comment: IIRC, the YCbCr computation is different between NTSC SD
(ITU
> 601) and NTSC HD (ITU 709). Strange but true.
yes, it seems that we're running into this. Skia is 709 and Blending is 601.
Interesting!
> 
>
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-vers...
> 
> > > 2. If so, lets all use SkComputeLuminance, and (as needed) correct its
> > > coefficients
> > > 3. If not, please add a comment above your Lum() local function
documenting
> > that
> > > it differs from SkComputeLuminance, and why.
> > 
> > I'm unsure which one is 'better'. Will there ever be a case where css
> luminance
> > is expected to be the same as blending? (Where is that used?)
> > If yes, they should be the same.
> > 
> > > 
> > > I guess we don't have an existing micro-bench for individual xfermodes. I
> will
> > > work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
bungeman
On 2013年02月25日 18:49:13, RikC wrote: > On 2013年02月25日 18:39:48, Stephen White wrote: > > On ...
12 years, 10 months ago (2013年02月25日 19:10:54 UTC) #29
On 2013年02月25日 18:49:13, RikC wrote:
> On 2013年02月25日 18:39:48, Stephen White wrote:
> > On 2013年02月25日 18:33:00, RikC wrote:
> > > On 2013年02月25日 17:43:47, reed1 wrote:
> > > > The coefficients we use for Luminance are derived from
> > > > http://www.itu.int/rec/R-REC-BT.709/
> > > > 
> > > > Our understanding is that these are also referenced by CSS itself
(adding
> > Ben
> > > > for more details).
> > > > 
> > > > 1. Is there a correct set of coefficients we should use throughout Skia?
> > > 
> > > The one that the blend modes are using, are derived from NTSC (see PDF
> > reference
> > > manual 1.7, section 6.2.1)
> > 
> > Drive-by comment: IIRC, the YCbCr computation is different between NTSC SD
> (ITU
> > 601) and NTSC HD (ITU 709). Strange but true.
> 
> yes, it seems that we're running into this. Skia is 709 and Blending is 601.
> Interesting!
> 
Yes, the reason to go with 709 in Skia is primarily that CSS says all colors are
sRGB (unless they aren't). The sRGB specification (from color.org, summary of
the sRGB portion of iec 61966-2-1) references 709.
> > 
> >
>
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-vers...
> > 
> > > > 2. If so, lets all use SkComputeLuminance, and (as needed) correct its
> > > > coefficients
> > > > 3. If not, please add a comment above your Lum() local function
> documenting
> > > that
> > > > it differs from SkComputeLuminance, and why.
> > > 
> > > I'm unsure which one is 'better'. Will there ever be a case where css
> > luminance
> > > is expected to be the same as blending? (Where is that used?)
> > > If yes, they should be the same.
> > > 
> > > > 
> > > > I guess we don't have an existing micro-bench for individual xfermodes.
I
> > will
> > > > work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
RikC
On 2013年02月25日 19:10:54, bungeman wrote: > On 2013年02月25日 18:49:13, RikC wrote: > > On 2013年02月25日 ...
12 years, 10 months ago (2013年02月25日 19:25:24 UTC) #30
On 2013年02月25日 19:10:54, bungeman wrote:
> On 2013年02月25日 18:49:13, RikC wrote:
> > On 2013年02月25日 18:39:48, Stephen White wrote:
> > > On 2013年02月25日 18:33:00, RikC wrote:
> > > > On 2013年02月25日 17:43:47, reed1 wrote:
> > > > > The coefficients we use for Luminance are derived from
> > > > > http://www.itu.int/rec/R-REC-BT.709/
> > > > > 
> > > > > Our understanding is that these are also referenced by CSS itself
> (adding
> > > Ben
> > > > > for more details).
> > > > > 
> > > > > 1. Is there a correct set of coefficients we should use throughout
Skia?
> > > > 
> > > > The one that the blend modes are using, are derived from NTSC (see PDF
> > > reference
> > > > manual 1.7, section 6.2.1)
> > > 
> > > Drive-by comment: IIRC, the YCbCr computation is different between NTSC
SD
> > (ITU
> > > 601) and NTSC HD (ITU 709). Strange but true.
> > 
> > yes, it seems that we're running into this. Skia is 709 and Blending is 601.
> > Interesting!
> > 
> 
> Yes, the reason to go with 709 in Skia is primarily that CSS says all colors
are
> sRGB (unless they aren't). The sRGB specification (from http://color.org,
summary of
> the sRGB portion of iec 61966-2-1) references 709.
> 
Which one? there's more than 1 sRGB standard :-)
It seems fine that you're moving to the new one, as long as they're not expected
to match. Where are you using luminance in skia/chrome?
> > > 
> > >
> >
>
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-vers...
> > > 
> > > > > 2. If so, lets all use SkComputeLuminance, and (as needed) correct its
> > > > > coefficients
> > > > > 3. If not, please add a comment above your Lum() local function
> > documenting
> > > > that
> > > > > it differs from SkComputeLuminance, and why.
> > > > 
> > > > I'm unsure which one is 'better'. Will there ever be a case where css
> > > luminance
> > > > is expected to be the same as blending? (Where is that used?)
> > > > If yes, they should be the same.
> > > > 
> > > > > 
> > > > > I guess we don't have an existing micro-bench for individual
xfermodes.
> I
> > > will
> > > > > work to add one, so this CL need not be held up for that.
Sign in to reply to this message.
bungeman
> > > > Yes, the reason to go with 709 in Skia is primarily ...
12 years, 10 months ago (2013年02月25日 19:44:48 UTC) #31
> > 
> > Yes, the reason to go with 709 in Skia is primarily that CSS says all colors
> are
> > sRGB (unless they aren't). The sRGB specification (from http://color.org,
> summary of
> > the sRGB portion of iec 61966-2-1) references 709.
> > 
> 
> Which one? there's more than 1 sRGB standard :-)
> It seems fine that you're moving to the new one, as long as they're not
expected
> to match. Where are you using luminance in skia/chrome?
> 
This one
http://webstore.iec.ch/webstore/webstore.nsf/Artnum_PK/25408
I think the only thing it's really used for is back-forming regular anti-aliased
glyphs from lcd anti-aliased glyphs, and figuring out which gamma hack to use.
So not much at the moment. Currently only the text blits take any color space
information into account, the rest of the blits are done linear.
Sign in to reply to this message.
RikC
On 2013年02月25日 19:44:48, bungeman wrote: > > > > > > Yes, the reason to ...
12 years, 10 months ago (2013年02月25日 20:50:09 UTC) #32
On 2013年02月25日 19:44:48, bungeman wrote:
> > > 
> > > Yes, the reason to go with 709 in Skia is primarily that CSS says all
colors
> > are
> > > sRGB (unless they aren't). The sRGB specification (from http://color.org,
> > summary of
> > > the sRGB portion of iec 61966-2-1) references 709.
> > > 
> > 
> > Which one? there's more than 1 sRGB standard :-)
> > It seems fine that you're moving to the new one, as long as they're not
> expected
> > to match. Where are you using luminance in skia/chrome?
> > 
> 
> This one
> http://webstore.iec.ch/webstore/webstore.nsf/Artnum_PK/25408
> 
> I think the only thing it's really used for is back-forming regular
anti-aliased
> glyphs from lcd anti-aliased glyphs, and figuring out which gamma hack to use.
> So not much at the moment. Currently only the text blits take any color space
> information into account, the rest of the blits are done linear.
So, should we update that to use the old values? It seems that keeping them
separate would be less invasive since this will change the rendering a lot.
(PS Are you adjusting for gamma as well for glyph AA?)
Sign in to reply to this message.
reed1
It is unfortunate that this spec has chosen the older values. If that cannot be ...
12 years, 10 months ago (2013年02月25日 21:05:23 UTC) #33
It is unfortunate that this spec has chosen the older values. If that cannot be
corrected/changed (?) then I agree we should just agree to have a private impl
for luminance w/ these new xfermodes. Please add a comment in Lum()
acknowledging that SkComputeLuminance exists, but that your spec requires
different coefficients (so the next reader does not ask the same question).
Sign in to reply to this message.
RikC
On 2013年02月25日 21:05:23, reed1 wrote: > It is unfortunate that this spec has chosen the ...
12 years, 10 months ago (2013年02月25日 21:36:48 UTC) #34
On 2013年02月25日 21:05:23, reed1 wrote:
> It is unfortunate that this spec has chosen the older values. If that cannot
be
> corrected/changed (?) 
The blending spec was written 15 years or so ago and integrated into a bunch of
applications, frameworks and operating systems so unfortunately it can't be
changed. (This is actually not a big deal since the formula is not really trying
to work with actual luminosity)
> then I agree we should just agree to have a private impl
> for luminance w/ these new xfermodes. Please add a comment in Lum()
> acknowledging that SkComputeLuminance exists, but that your spec requires
> different coefficients (so the next reader does not ask the same question).
Will do.
Sign in to reply to this message.
RikC
On 2013年02月25日 21:05:23, reed1 wrote: > It is unfortunate that this spec has chosen the ...
12 years, 10 months ago (2013年02月26日 04:33:51 UTC) #35
On 2013年02月25日 21:05:23, reed1 wrote:
> It is unfortunate that this spec has chosen the older values. If that cannot
be
> corrected/changed (?) then I agree we should just agree to have a private impl
> for luminance w/ these new xfermodes. Please add a comment in Lum()
> acknowledging that SkComputeLuminance exists, but that your spec requires
> different coefficients (so the next reader does not ask the same question).
Done
Sign in to reply to this message.
reed1
lgtm
12 years, 10 months ago (2013年02月26日 13:56:06 UTC) #36
lgtm
Sign in to reply to this message.
RikC
On 2013年02月26日 13:56:06, reed1 wrote: > lgtm Great! Does that mean it will be submitted?
12 years, 10 months ago (2013年02月26日 16:53:17 UTC) #37
On 2013年02月26日 13:56:06, reed1 wrote:
> lgtm
Great! Does that mean it will be submitted?
Sign in to reply to this message.
RikC
On 2013年02月26日 13:56:06, reed1 wrote: > lgtm Can it be submitted to the depot? Has ...
12 years, 10 months ago (2013年02月27日 16:31:49 UTC) #38
On 2013年02月26日 13:56:06, reed1 wrote:
> lgtm
Can it be submitted to the depot?
Has any work been done on the GPU implementation?
Sign in to reply to this message.
RikC
On 2013年02月27日 16:31:49, RikC wrote: > On 2013年02月26日 13:56:06, reed1 wrote: > > lgtm > ...
12 years, 10 months ago (2013年03月01日 18:12:07 UTC) #39
On 2013年02月27日 16:31:49, RikC wrote:
> On 2013年02月26日 13:56:06, reed1 wrote:
> > lgtm
> 
> Can it be submitted to the depot?
> Has any work been done on the GPU implementation?
ping
Sign in to reply to this message.
reed1
Some warnings that need to be fixed (we treat these as errors on some of ...
12 years, 10 months ago (2013年03月04日 17:16:27 UTC) #40
Some warnings that need to be fixed (we treat these as errors on some of our
bots)
cc1plus: warnings being treated as errors
/skia2/trunk/gyp/../src/core/SkXfermode.cpp: In function 'int Sat(int, int,
int)':
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:448: warning: converting to 'int'
from 'SkScalar'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp: In function 'void SetSat(int*,
int*, int*, float)':
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:466: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:468: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:470: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:473: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:475: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:477: warning: passing 'float' for
argument 4 to 'void setSaturationComponents(int*, int*, int*, int)'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp: In function 'void clipColor(int*,
int*, int*)':
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:483: warning: converting to 'int'
from 'SkScalar'
/skia2/trunk/gyp/../src/core/SkXfermode.cpp:484: warning: converting to 'int'
from 'SkScalar'
Sign in to reply to this message.
reed1
Perhaps you should start a new CL... if you do, it will be hosted by ...
12 years, 10 months ago (2013年03月04日 17:17:12 UTC) #41
Perhaps you should start a new CL... if you do, it will be hosted by chromium
which has the nice side-effect of offering try-bots, so you can see these
warnings/errors yourself.
Sign in to reply to this message.
RikC
On 2013年03月04日 17:17:12, reed1 wrote: > Perhaps you should start a new CL... if you ...
12 years, 10 months ago (2013年03月04日 17:19:45 UTC) #42
On 2013年03月04日 17:17:12, reed1 wrote:
> Perhaps you should start a new CL... if you do, it will be hosted by chromium
> which has the nice side-effect of offering try-bots, so you can see these
> warnings/errors yourself.
Is that a CL on skia or chromium? How is it hosted by chromium?
Sign in to reply to this message.
reed1
the chromium part of the URL is a side-effect of us trying to share code. ...
12 years, 10 months ago (2013年03月04日 17:27:04 UTC) #43
the chromium part of the URL is a side-effect of us trying to share code. the CL
will *not* be part of chrome per-se.
If you sync, and re-run 'gcl change foo', it should create a new CL with the new
backend.
Sign in to reply to this message.
RikC
On 2013年03月04日 17:27:04, reed1 wrote: > the chromium part of the URL is a side-effect ...
12 years, 10 months ago (2013年03月04日 18:57:03 UTC) #44
On 2013年03月04日 17:27:04, reed1 wrote:
> the chromium part of the URL is a side-effect of us trying to share code. the
CL
> will *not* be part of chrome per-se.
> 
> If you sync, and re-run 'gcl change foo', it should create a new CL with the
new
> backend.
created new cl https://codereview.chromium.org/12393049/ 
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /