pp::Graphics2D

77 views
Skip to first unread message

Alessandro Alghisi

unread,
Mar 29, 2016, 5:09:11 PM3/29/16
to peppe...@chromium.org, Alex Vallée, W. James Maclean
Hi all,

I would like to add a function in the pp::Graphics2D that allows me to transform without repainting twice.

bool SetPaintTransform(float scale, pp::FloatPoint Origin, pp::FloatPoint Transform);


Usage: I will use this API for the pinch zoom inside the PDF Plugin. This also allows other plugins to implement any transformation like pinch zoom.
Reason: By using SetScale and Scroll we will require to call PaintImageData after each of those operations and would lead us to a flickering image.  I would like to be able to compute both scaling and transform at the same time with only one PaintImageData call so no flickering would occur anymore.

Thanks

Raymes Khoury

unread,
Mar 29, 2016, 8:35:08 PM3/29/16
to Alessandro Alghisi, peppe...@chromium.org, Alex Vallée, W. James Maclean, Bill Budge, Lei Zhang, Antoine Labour
Hey Alessandro,

Unfortunately we're very reluctant to add new stuff to pepper because we don't have resources to review/maintain it. Have you considered other alternatives? 

Thanks,
Raymes

W. James MacLean

unread,
Mar 30, 2016, 8:57:15 AM3/30/16
to Raymes Khoury, Alessandro Alghisi, peppe...@chromium.org, Alex Vallée, Bill Budge, Lei Zhang, Antoine Labour, Michael Knowles
Hi Raymes,

I'm not really sure that there are (performant) alternatives, though if you have suggestions I'm interested in hearing them.

I think this needs to be done in Pepper since the logic controlling plugin bitmaps, and how the pixels get to the screen, lives there. It seems reasonable to allow more general transforms in this process to facilitate more-intelligent pinch-zoom for plugins.

We're happy to take on some of the maintenance workload w.r.t. this, but we aren't owners and so need someone to help with the reviews.

Cheers,

James


GoogleAnimated.gif

W. James MacLean

Software Engineer

Google Waterloo, Canada


Alessandro Alghisi

unread,
Apr 4, 2016, 4:13:05 PM4/4/16
to Antoine Labour, W. James Maclean, David Bokan, Lei Zhang, Raymes Khoury, Michael Knowles, peppe...@chromium.org, Alex Vallée, Bill Budge
Adding people back to the conversation :)

On Mon, Apr 4, 2016 at 3:15 PM, Antoine Labour <pi...@google.com> wrote:


On Mon, Apr 4, 2016 at 11:45 AM, Alessandro Alghisi <aless...@google.com> wrote:
Here is the design doc: https://docs.google.com/document/d/1KDQu3blvKhHnRGnFxE36ea8uAxtfvhL1rfeL0FTuUTY

Antoine Labour it is a transformation on the paint contents 

That means the scaling must be done in software, and pixels need to be uploaded again, every frame. That seems bad. If this was scaling the Graphics2D, we could implement it by adding a transform to the layer (like SetScale is done), so that it'd be virtually free. What would be the problem with that approach?

Antoine



On Wed, Mar 30, 2016 at 9:33 PM, Antoine Labour <pi...@google.com> wrote:


On Wed, Mar 30, 2016 at 5:33 PM, Raymes Khoury <ray...@google.com> wrote:
-pepper-dev for the time being

Thanks James! A few more questions that might help move forward: Is there a doc with more details about how pinch zoom will work with PDF? Have you chatted with the guys working on the skia backend for PDF to see if it would be easier to do once that is implemented?

+Antoine Labour does the API sound reasonable to you? Should we make the API public or private? Should we just put it into PPB_PDF?

I don't think I understand what the API does exactly. Is it a transformation on the layer (like SetScale) or on the paint contents (like Scroll)?

Antoine
 

Thanks!

W. James MacLean

unread,
Apr 4, 2016, 4:15:34 PM4/4/16
to Alessandro Alghisi, Antoine Labour, David Bokan, Lei Zhang, Raymes Khoury, Michael Knowles, peppe...@chromium.org, Alex Vallée, Bill Budge
That is the end-goal, though when we eventually have to re-render the pixels (since scaling up the texture makes it fuzzy), we thought we would start with this.


GoogleAnimated.gif

W. James MacLean

Software Engineer

Google Waterloo, Canada



Reply all
Reply to author
Forward
0 new messages