LGTM https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906 src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url); Do we need to clip the ...
13 years, 6 months ago
(2012-06-28 20:56:12 UTC)
#5
Alternate crazy idea: Add a new hook to SkPaint (ala shader) for annotations. This has ...
13 years, 6 months ago
(2012-06-28 21:22:00 UTC)
#7
Alternate crazy idea:
Add a new hook to SkPaint (ala shader) for annotations. This has the advantage
of being a (potentially) smaller change, since I don't have to edit all canvas
subclasses. It has the disadvantage of adding a new hook to SkPaint (which it
already has in abundance).
e.g.
SkPaint::setAnnotation(SkData);
or
SkPaint::setAnnotation(GUID, SkData);
or
SkPaint::setAnnotation(SkMetaData);
or
...?
I'm a little reluctant to create yet-another-virtual-baseclass for this, though
that would be fun. If we can get away with something more declarative, it makes
for an easier time to copy/flatten/etc. the payload.
thoughts?
On 2012/06/28 21:18:07, reed1 wrote: > On 2012/06/28 20:56:12, Steve VanDeBogart wrote: > > LGTM ...
13 years, 6 months ago
(2012-06-28 21:25:47 UTC)
#8
On 2012/06/28 21:18:07, reed1 wrote:
> On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > LGTM
> >
> > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > File src/core/SkCanvas.cpp (right):
> >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > Do we need to clip the rect to the device's clip here?
>
> Probably right. I can add quickReject here, to entirely skip the URL if its
> clipped out. I don't think I should reduce the rect if its partially clipped
> though.
Consider a link that's in an iframe scrolled so that only part of the link is
visible... we don't want to make the invisible part of the link clickable...
On 2012/06/28 21:25:47, Steve VanDeBogart wrote: > On 2012/06/28 21:18:07, reed1 wrote: > > On ...
13 years, 6 months ago
(2012-06-28 21:26:57 UTC)
#9
On 2012/06/28 21:25:47, Steve VanDeBogart wrote:
> On 2012/06/28 21:18:07, reed1 wrote:
> > On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > > LGTM
> > >
> > > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > > File src/core/SkCanvas.cpp (right):
> > >
> > >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > > Do we need to clip the rect to the device's clip here?
> >
> > Probably right. I can add quickReject here, to entirely skip the URL if its
> > clipped out. I don't think I should reduce the rect if its partially clipped
> > though.
>
> Consider a link that's in an iframe scrolled so that only part of the link is
> visible... we don't want to make the invisible part of the link clickable...
I think this approach will be harder to fit in with the current WebKit code.
While the churn of adding stuff to SkCanvas is annoying, I think it's the right
approach in this case.
On 2012/06/28 21:25:47, Steve VanDeBogart wrote: > On 2012/06/28 21:18:07, reed1 wrote: > > On ...
13 years, 6 months ago
(2012-06-28 21:27:02 UTC)
#10
On 2012/06/28 21:25:47, Steve VanDeBogart wrote:
> On 2012/06/28 21:18:07, reed1 wrote:
> > On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > > LGTM
> > >
> > > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > > File src/core/SkCanvas.cpp (right):
> > >
> > >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > > Do we need to clip the rect to the device's clip here?
> >
> > Probably right. I can add quickReject here, to entirely skip the URL if its
> > clipped out. I don't think I should reduce the rect if its partially clipped
> > though.
>
> Consider a link that's in an iframe scrolled so that only part of the link is
> visible... we don't want to make the invisible part of the link clickable...
Isn't that the job of the device that "plays back" the annotation? If the rect
is complexly clipped (even antialiased complexly clipped), what data should I
pass to the device?
On 2012/06/28 21:26:57, Steve VanDeBogart wrote: > On 2012/06/28 21:25:47, Steve VanDeBogart wrote: > > ...
13 years, 6 months ago
(2012-06-28 21:29:48 UTC)
#11
On 2012/06/28 21:26:57, Steve VanDeBogart wrote:
> On 2012/06/28 21:25:47, Steve VanDeBogart wrote:
> > On 2012/06/28 21:18:07, reed1 wrote:
> > > On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > > > LGTM
> > > >
> > > > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > > > File src/core/SkCanvas.cpp (right):
> > > >
> > > >
> > >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > > > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > > > Do we need to clip the rect to the device's clip here?
> > >
> > > Probably right. I can add quickReject here, to entirely skip the URL if
its
> > > clipped out. I don't think I should reduce the rect if its partially
clipped
> > > though.
> >
> > Consider a link that's in an iframe scrolled so that only part of the link
is
> > visible... we don't want to make the invisible part of the link clickable...
>
> I think this approach will be harder to fit in with the current WebKit code.
> While the churn of adding stuff to SkCanvas is annoying, I think it's the
right
> approach in this case.
In the crazy approach, addRectURL would look like this:
addRectURL(rect, url) {
SkPaint paint;
paint.setAnnotation(..., url);
canvas.drawRect(rect, paint);
}
with some mechanism to tell us to *not* actually render the rect (perhaps some
flag on the annotation itself)?
On 2012/06/28 21:27:02, reed1 wrote: > On 2012/06/28 21:25:47, Steve VanDeBogart wrote: > > On ...
13 years, 6 months ago
(2012-06-28 21:39:53 UTC)
#12
On 2012/06/28 21:27:02, reed1 wrote:
> On 2012/06/28 21:25:47, Steve VanDeBogart wrote:
> > On 2012/06/28 21:18:07, reed1 wrote:
> > > On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > > > LGTM
> > > >
> > > > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > > > File src/core/SkCanvas.cpp (right):
> > > >
> > > >
> > >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > > > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > > > Do we need to clip the rect to the device's clip here?
> > >
> > > Probably right. I can add quickReject here, to entirely skip the URL if
its
> > > clipped out. I don't think I should reduce the rect if its partially
clipped
> > > though.
> >
> > Consider a link that's in an iframe scrolled so that only part of the link
is
> > visible... we don't want to make the invisible part of the link clickable...
>
> Isn't that the job of the device that "plays back" the annotation? If the rect
> is complexly clipped (even antialiased complexly clipped), what data should I
> pass to the device?
In PDF, annotations are specified at the page level, i.e. not inline with
drawing, so I don't think clipping applies to them. It's fair that you can't
apply a complex clip to them. Looking again, maybe WebKit will handle the case
that I mentioned with the iframe. So... nevermind this.
On 2012/06/28 21:29:48, reed1 wrote: > On 2012/06/28 21:26:57, Steve VanDeBogart wrote: > > On ...
13 years, 6 months ago
(2012-06-28 21:40:26 UTC)
#13
On 2012/06/28 21:29:48, reed1 wrote:
> On 2012/06/28 21:26:57, Steve VanDeBogart wrote:
> > On 2012/06/28 21:25:47, Steve VanDeBogart wrote:
> > > On 2012/06/28 21:18:07, reed1 wrote:
> > > > On 2012/06/28 20:56:12, Steve VanDeBogart wrote:
> > > > > LGTM
> > > > >
> > > > > https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp
> > > > > File src/core/SkCanvas.cpp (right):
> > > > >
> > > > >
> > > >
> > >
> >
>
https://codereview.appspot.com/6354052/diff/1/src/core/SkCanvas.cpp#newcode1906
> > > > > src/core/SkCanvas.cpp:1906: iter.fDevice->addRectURL(rect, url);
> > > > > Do we need to clip the rect to the device's clip here?
> > > >
> > > > Probably right. I can add quickReject here, to entirely skip the URL if
> its
> > > > clipped out. I don't think I should reduce the rect if its partially
> clipped
> > > > though.
> > >
> > > Consider a link that's in an iframe scrolled so that only part of the link
> is
> > > visible... we don't want to make the invisible part of the link
clickable...
> >
> > I think this approach will be harder to fit in with the current WebKit code.
> > While the churn of adding stuff to SkCanvas is annoying, I think it's the
> right
> > approach in this case.
>
> In the crazy approach, addRectURL would look like this:
>
> addRectURL(rect, url) {
> SkPaint paint;
> paint.setAnnotation(..., url);
> canvas.drawRect(rect, paint);
> }
>
> with some mechanism to tell us to *not* actually render the rect (perhaps some
> flag on the annotation itself)?
Hmm, I guess that could work.
Issue 6354052: SkCanvas::addRectURL -- to record URL annotation (destined for printers)
Created 13 years, 6 months ago by reed1
Modified 13 years, 6 months ago
Reviewers: bungeman, Steve VanDeBogart, bsalomon
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 1