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

Issue 10704198: Scale to DIPs in ppb_graphics2d_impl for proper invalidation (Closed)

Created:
8 years, 5 months ago by Josh Horwich
Modified:
8 years, 5 months ago
Reviewers:
brettw, Wez
CC:
chromium-reviews, darin-cc_chromium.org
Visibility:
Public.

Description

Scale to DIPs in ppb_graphics2d_impl for proper invalidation If a Pepper plugin uses PaintImageData or Scroll in a pp::Graphics2D context that has a scale factor, we need to convert the invalidated area to DIPs. BUG=137163 TEST=Manual - run HiDPI-compatible plugin that uses PaintImageData TEST=gfx_unittests --gtest_filter="Rect*" Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147952

Patch Set 1 #

Total comments: 11

Patch Set 2 : Make generic ScaleBounds method, handle scroll properly #

Total comments: 4

Patch Set 3 : Separate function for computation, add unit test #

Patch Set 4 : Move ScaleBounds back out of gfx::Rect #

Total comments: 12

Patch Set 5 : Tweaks based on review feedback #

Patch Set 6 : Skip math in common (scale=1) case #

Patch Set 7 : Separate bounds scale from delta scale #

Total comments: 8

Patch Set 8 : Explicitly include ui/gfx/rect #

Patch Set 9 : Fix shared_lib build, simplify based on feedback and fix nits #

Total comments: 4

Patch Set 10 : Move things to ConvertToLogicalPixels #

Patch Set 11 : Remove dead code #

Total comments: 1

Patch Set 12 : Fix a nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -1 line) Patch
M webkit/plugins/ppapi/ppb_graphics_2d_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppb_graphics_2d_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +46 lines, -1 line 0 comments Download
A webkit/plugins/ppapi/ppb_graphics_2d_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +80 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_shell.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Wez
https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode353 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:353: // Set |nothing_visible| to false if the change overlaps ...
8 years, 5 months ago (2012-07-13 21:29:57 UTC) #1
Josh Horwich
Thank you for the early/fast feedback. https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode353 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:353: // Set |nothing_visible| ...
8 years, 5 months ago (2012-07-13 22:01:23 UTC) #2
Wez
https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode355 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:355: left = floor(op_rect.x() * scale_); Do we need to ...
8 years, 5 months ago (2012-07-16 17:41:43 UTC) #3
Josh Horwich
Updated based on feedback, and I split the computation of the bounds rect out since ...
8 years, 5 months ago (2012-07-16 23:26:46 UTC) #4
Wez
https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): https://chromiumcodereview.appspot.com/10704198/diff/1/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode357 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:357: right = ceil((op_rect.x() + op_rect.width()) * scale_); Out of ...
8 years, 5 months ago (2012-07-17 17:10:15 UTC) #5
Josh Horwich
Adding reviewers - please take a look sky for ui (let me know if you ...
8 years, 5 months ago (2012-07-17 17:49:57 UTC) #6
brettw
https://chromiumcodereview.appspot.com/10704198/diff/3002/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): https://chromiumcodereview.appspot.com/10704198/diff/3002/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode353 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:353: // Convert op_rect from context coordinates to logical pixels, ...
8 years, 5 months ago (2012-07-17 19:27:50 UTC) #7
sky
https://chromiumcodereview.appspot.com/10704198/diff/3002/ui/gfx/rect.h File ui/gfx/rect.h (right): https://chromiumcodereview.appspot.com/10704198/diff/3002/ui/gfx/rect.h#newcode51 ui/gfx/rect.h:51: void ScaleBounds(float scale); rect_base already has Scale(float). Is there ...
8 years, 5 months ago (2012-07-17 22:12:12 UTC) #8
Josh Horwich
Please take a look https://chromiumcodereview.appspot.com/10704198/diff/3002/ui/gfx/rect.h File ui/gfx/rect.h (right): https://chromiumcodereview.appspot.com/10704198/diff/3002/ui/gfx/rect.h#newcode51 ui/gfx/rect.h:51: void ScaleBounds(float scale); On 2012/07/17 ...
8 years, 5 months ago (2012-07-17 22:53:36 UTC) #9
sky
On Tue, Jul 17, 2012 at 3:53 PM, <jhorwich@chromium.org> wrote: > Please take a look ...
8 years, 5 months ago (2012-07-17 23:31:18 UTC) #10
Josh Horwich
Please take a look As per an offline discussion with sky, I've moved the bounds-specific ...
8 years, 5 months ago (2012-07-18 23:46:12 UTC) #11
sky
This means you no longer need me as a reviewer. I've removed myself.
8 years, 5 months ago (2012-07-19 00:08:21 UTC) #12
Wez
My 2c. http://codereview.chromium.org/10704198/diff/10001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/10001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode127 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:127: // fully contain the original. nit: Consider ...
8 years, 5 months ago (2012-07-19 01:33:37 UTC) #13
Josh Horwich
Please take a look http://codereview.chromium.org/10704198/diff/10001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/10001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode127 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:127: // fully contain the original. ...
8 years, 5 months ago (2012-07-19 22:22:44 UTC) #14
Wez
http://codereview.chromium.org/10704198/diff/21001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/21001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode361 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:361: scroll = true; Is the float multiplication overhead sufficient ...
8 years, 5 months ago (2012-07-20 00:01:41 UTC) #15
Josh Horwich
please take a look - updates based on review feedback, and fixed shared_lib build http://codereview.chromium.org/10704198/diff/21001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc ...
8 years, 5 months ago (2012-07-20 02:30:22 UTC) #16
Wez
Looks good - Brett, you want to take a look? http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode369 ...
8 years, 5 months ago (2012-07-20 05:31:15 UTC) #17
brettw
http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode354 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:354: gfx::Point scroll_delta(operation.scroll_dx, operation.scroll_dy); When I suggested a different function, ...
8 years, 5 months ago (2012-07-20 20:56:45 UTC) #18
Wez
On 2012/07/20 20:56:45, brettw wrote: > http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc > File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): > > http://codereview.chromium.org/10704198/diff/24001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode354 > ...
8 years, 5 months ago (2012-07-20 21:25:22 UTC) #19
Josh Horwich
Please take a look (or given the goose comment, should I say, "please take a ...
8 years, 5 months ago (2012-07-20 22:33:08 UTC) #20
brettw
lgtm http://codereview.chromium.org/10704198/diff/28001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc File webkit/plugins/ppapi/ppb_graphics_2d_impl.cc (right): http://codereview.chromium.org/10704198/diff/28001/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc#newcode369 webkit/plugins/ppapi/ppb_graphics_2d_impl.cc:369: // Conversion requires falling back to InvalidateRect Nit: ...
8 years, 5 months ago (2012-07-23 19:09:52 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jhorwich@chromium.org/10704198/21006
8 years, 5 months ago (2012-07-23 19:55:23 UTC) #22
commit-bot: I haz the power
8 years, 5 months ago (2012-07-23 21:24:17 UTC) #23
Change committed as 147952

Powered by Google App Engine
This is Rietveld 408576698