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

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed)

Created:
8 years, 10 months ago by Jeff Timanus
Modified:
8 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, jam, dpranke-watch+content_chromium.org, pam+watch_chromium.org
Visibility:
Public.

Description

Remove redundant memory clears when constructing BitmapPlatformDevice instances on Mac and Windows. PlatformCanvas construction is showing up as a performance bottleneck due to unnecessary initialization. The change moves the clear to the call sites where it is necessary. Note: On Linux, cairo always allocates an initialized surface, so there is no way to bypass the performance penalty. BUG=112009 TEST=All of them Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=127196

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : More build fixes. #

Patch Set 4 : #

Patch Set 5 : Fixing linux build issues. #

Patch Set 6 : #

Patch Set 7 : Convert to a flags-enum instead of bool, bool. #

Patch Set 8 : Correct win and mac build errors. #

Patch Set 9 : Rebase to 123041. #

Patch Set 10 : Address style issues. #

Patch Set 11 : Address style issues. #

Patch Set 12 : Address style issues. #

Total comments: 7

Patch Set 13 : #

Patch Set 14 : Use sites now clear if necessary. #

Total comments: 2

Patch Set 15 : #

Patch Set 16 : Correct use of SkCanvas::clear call. #

Patch Set 17 : Remove now-invalid unit-test, VectorCanvasTest::Uninitialized #

Patch Set 18 : #

Patch Set 19 : #

Total comments: 9

Patch Set 20 : #

Total comments: 8

Patch Set 21 : Address comments & add BitmapPlatformDevice::CreateAndClear. #

Total comments: 16

Patch Set 22 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -71 lines) Patch
M skia/ext/bitmap_platform_device_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +10 lines, -1 line 0 comments Download
M skia/ext/bitmap_platform_device_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +13 lines, -9 lines 0 comments Download
M skia/ext/bitmap_platform_device_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +11 lines, -1 line 0 comments Download
M skia/ext/bitmap_platform_device_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +8 lines, -0 lines 0 comments Download
M skia/ext/bitmap_platform_device_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +11 lines, -1 line 0 comments Download
M skia/ext/bitmap_platform_device_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +12 lines, -6 lines 0 comments Download
M skia/ext/bitmap_platform_device_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +16 lines, -5 lines 0 comments Download
M skia/ext/bitmap_platform_device_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +28 lines, -14 lines 0 comments Download
D skia/ext/data/vectorcanvastest/uninitialized/00_pc_empty.png View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Binary file 0 comments Download
D skia/ext/data/vectorcanvastest/uninitialized/00_vc_empty.png View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Binary file 0 comments Download
M skia/ext/platform_canvas_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M skia/ext/platform_canvas_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M skia/ext/vector_canvas_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -20 lines 0 comments Download
M skia/ext/vector_platform_device_emf_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M skia/ext/vector_platform_device_skia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -12 lines 0 comments Download
M ui/gfx/canvas_skia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +6 lines, -0 lines 0 comments Download
M ui/gfx/canvas_skia_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Jeff Timanus
Alok & Steve, PTAL. This change is pretty straight-forward: I added some flags to specify ...
8 years, 10 months ago (2012-02-22 19:08:40 UTC) #1
alokp
I have two main issues with this patch: 1. We have painstakingly removed unnecessary references ...
8 years, 10 months ago (2012-02-22 21:35:54 UTC) #2
Jeff Timanus
On 2012/02/22 21:35:54, Alok Priyadarshi wrote: > I have two main issues with this patch: ...
8 years, 10 months ago (2012-02-22 21:53:55 UTC) #3
alokp
On 2012/02/22 21:53:55, Jeff Timanus wrote: > On 2012/02/22 21:35:54, Alok Priyadarshi wrote: > > ...
8 years, 10 months ago (2012-02-22 22:03:43 UTC) #4
Jeff Timanus
On 2012/02/22 22:03:43, Alok Priyadarshi wrote: > On 2012/02/22 21:53:55, Jeff Timanus wrote: > > ...
8 years, 10 months ago (2012-02-23 16:05:54 UTC) #5
Jeff Timanus
After reviewing the locations where I found initialization to be necessary, it seems that the ...
8 years, 10 months ago (2012-02-23 22:14:10 UTC) #6
Jeff Timanus
Please have another look. The change has now been simplified to call clear where necessary. ...
8 years, 9 months ago (2012-02-29 16:18:35 UTC) #7
alokp
looks better. http://codereview.chromium.org/9416017/diff/39001/skia/ext/platform_canvas_unittest.cc File skia/ext/platform_canvas_unittest.cc (right): http://codereview.chromium.org/9416017/diff/39001/skia/ext/platform_canvas_unittest.cc#newcode197 skia/ext/platform_canvas_unittest.cc:197: canvas.drawARGB(0, 0, 0, 0); eraseARGB? and everywhere ...
8 years, 9 months ago (2012-03-01 17:09:02 UTC) #8
Jeff Timanus
Patch 15 includes a file missing from the previous patch set: Removal of the clear ...
8 years, 9 months ago (2012-03-01 18:35:49 UTC) #9
Jeff Timanus
The try run for patch 15 introduced quite a few unexpected failures on mac. It's ...
8 years, 9 months ago (2012-03-02 16:54:40 UTC) #10
Jeff Timanus
Steve, can you please have a look at this change? Alok is out for the ...
8 years, 9 months ago (2012-03-14 21:53:41 UTC) #11
Jeff Timanus
On 2012/03/14 21:53:41, Jeff Timanus wrote: > Steve, can you please have a look at ...
8 years, 9 months ago (2012-03-14 23:29:43 UTC) #12
vandebo (ex-Chrome)
Generally LG, just a few questions. I buy the premise that if the erase'd color ...
8 years, 9 months ago (2012-03-14 23:38:29 UTC) #13
Jeff Timanus
Thanks for the review. In general, I preferred preserving the existing behaviour when examining call ...
8 years, 9 months ago (2012-03-15 19:01:28 UTC) #14
Jeff Timanus
On 2012/03/14 23:29:43, Jeff Timanus wrote: > On 2012/03/14 21:53:41, Jeff Timanus wrote: > > ...
8 years, 9 months ago (2012-03-15 19:13:05 UTC) #15
vandebo (ex-Chrome)
LGTM if you're confident that the try failures aren't caused by these changes. https://chromiumcodereview.appspot.com/9416017/diff/85001/skia/ext/vector_platform_device_skia.cc File ...
8 years, 9 months ago (2012-03-15 20:40:56 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/9416017/86017
8 years, 9 months ago (2012-03-15 21:06:24 UTC) #17
commit-bot: I haz the power
Presubmit check for 9416017-86017 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 9 months ago (2012-03-15 21:06:30 UTC) #18
Jeff Timanus
James & Mike: Can you please LGTM stamp the changes in webkit, and ui/gfx. Thanks, ...
8 years, 9 months ago (2012-03-15 21:24:17 UTC) #19
jamesr
webkit/ LGTM
8 years, 9 months ago (2012-03-15 21:25:51 UTC) #20
msw
+Alexei, who is/knows a better reviewer for this CL. Sorry, I'm really only a ui/gfx ...
8 years, 9 months ago (2012-03-15 21:53:07 UTC) #21
Jeff Timanus
Mike, you are right about the possibility of skipping the clear based on is_opaque. At ...
8 years, 9 months ago (2012-03-15 22:26:53 UTC) #22
Alexei Svitkine (slow)
In addition to my comment below, could you add comments to the constructors and Create() ...
8 years, 9 months ago (2012-03-15 22:49:10 UTC) #23
Jeff Timanus
Alexei, I added the function you suggested, and made use of it where applicable. I ...
8 years, 9 months ago (2012-03-16 03:10:31 UTC) #24
Alexei Svitkine (slow)
LGTM. Thanks! https://chromiumcodereview.appspot.com/9416017/diff/83003/skia/ext/bitmap_platform_device_linux.h File skia/ext/bitmap_platform_device_linux.h (right): https://chromiumcodereview.appspot.com/9416017/diff/83003/skia/ext/bitmap_platform_device_linux.h#newcode74 skia/ext/bitmap_platform_device_linux.h:74: // Constructs a device with size |width| ...
8 years, 9 months ago (2012-03-16 05:57:56 UTC) #25
msw
I don't fully understand this code, so I'll defer approval to Alexei and others. I ...
8 years, 9 months ago (2012-03-16 07:13:22 UTC) #26
Jeff Timanus
https://chromiumcodereview.appspot.com/9416017/diff/83003/skia/ext/bitmap_platform_device_android.cc File skia/ext/bitmap_platform_device_android.cc (right): https://chromiumcodereview.appspot.com/9416017/diff/83003/skia/ext/bitmap_platform_device_android.cc#newcode40 skia/ext/bitmap_platform_device_android.cc:40: } else { On 2012/03/16 07:13:22, msw wrote: > ...
8 years, 9 months ago (2012-03-16 15:52:41 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/9416017/92010
8 years, 9 months ago (2012-03-16 15:53:39 UTC) #28
commit-bot: I haz the power
8 years, 9 months ago (2012-03-16 17:33:19 UTC) #29
Change committed as 127196

Powered by Google App Engine
This is Rietveld 408576698