Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Issue 10562027: Add target scale factor to gfx::Canvas (Closed)

Created:
8 years, 6 months ago by pkotwicz
Modified:
8 years, 5 months ago
Reviewers:
oshima, sky
CC:
chromium-reviews, mihaip-chromium-reviews_chromium.org, sadrul, nkostylev+watch_chromium.org, ben+watch_chromium.org, Aaron Boodman, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Add ability to build a canvas with a target scale factor. This allows ExtractBitmap() to return an ImageSkiaRep. This simplifies code around using intermediate bitmaps a lot. BUG=131475 TEST=Compiles R=oshima,sky TBR=sadrul Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144489

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 11

Patch Set 6 : #

Total comments: 2

Patch Set 7 : Changes as requested by oshima #

Total comments: 3

Patch Set 8 : #

Patch Set 9 : Fixed compile error on Windows #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : Rebased #

Patch Set 14 : Fixes interactive unittests on win #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -81 lines) Patch
M chrome/browser/chromeos/status/network_menu_icon.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -9 lines 0 comments Download
M chrome/renderer/print_web_view_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -2 lines 0 comments Download
M skia/ext/canvas_paint_common.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M skia/ext/canvas_paint_mac.h View 1 2 3 4 5 6 1 chunk +6 lines, -12 lines 0 comments Download
M ui/base/native_theme/native_theme_android.cc View 1 2 3 4 5 7 4 chunks +17 lines, -4 lines 0 comments Download
M ui/base/native_theme/native_theme_base.cc View 1 2 3 4 5 7 2 chunks +17 lines, -4 lines 0 comments Download
M ui/compositor/layer.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -9 lines 0 comments Download
M ui/gfx/canvas.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +49 lines, -5 lines 0 comments Download
M ui/gfx/canvas.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +71 lines, -17 lines 0 comments Download
M ui/gfx/canvas_skia_paint.h View 1 2 3 4 5 6 2 chunks +9 lines, -0 lines 0 comments Download
M ui/views/controls/button/image_button.h View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/controls/button/image_button.cc View 1 2 3 4 5 6 2 chunks +1 line, -7 lines 0 comments Download
M ui/views/drag_utils.cc View 1 2 3 4 5 6 3 chunks +7 lines, -8 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
pkotwicz
8 years, 6 months ago (2012-06-16 23:14:05 UTC) #1
oshima
http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_android.cc File ui/base/native_theme/native_theme_android.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_android.cc#newcode670 ui/base/native_theme/native_theme_android.cc:670: gfx::Canvas canvas(sk_canvas, target_scale_factor, false); webkit must have scale factor ...
8 years, 6 months ago (2012-06-18 17:13:08 UTC) #2
oshima
http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_base.cc File ui/base/native_theme/native_theme_base.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_base.cc#newcode1020 ui/base/native_theme/native_theme_base.cc:1020: gfx::Canvas canvas(sk_canvas, target_scale_factor, false); Looks like there is a ...
8 years, 6 months ago (2012-06-18 22:30:59 UTC) #3
pkotwicz
http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc#newcode79 ui/gfx/canvas.cc:79: ApplyTargetScaleFactor(target_scale_factor, scale_canvas); The idea is not to apply the ...
8 years, 6 months ago (2012-06-20 16:30:20 UTC) #4
oshima
it's time to add OWNERS i think. http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc#newcode79 ui/gfx/canvas.cc:79: ApplyTargetScaleFactor(target_scale_factor, scale_canvas); ...
8 years, 6 months ago (2012-06-20 18:04:40 UTC) #5
pkotwicz
Adding Scott for his opinion http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_android.cc File ui/base/native_theme/native_theme_android.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/base/native_theme/native_theme_android.cc#newcode670 ui/base/native_theme/native_theme_android.cc:670: gfx::Canvas canvas(sk_canvas, target_scale_factor, false); ...
8 years, 6 months ago (2012-06-20 23:07:05 UTC) #6
sky
http://codereview.chromium.org/10562027/diff/17001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): http://codereview.chromium.org/10562027/diff/17001/ui/gfx/canvas.h#newcode113 ui/gfx/canvas.h:113: Canvas(const gfx::Size& size, Oy, too many constructors. Any chance ...
8 years, 6 months ago (2012-06-21 00:03:32 UTC) #7
pkotwicz
http://codereview.chromium.org/10562027/diff/17001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): http://codereview.chromium.org/10562027/diff/17001/ui/gfx/canvas.h#newcode113 ui/gfx/canvas.h:113: Canvas(const gfx::Size& size, This code actually only adds a ...
8 years, 6 months ago (2012-06-21 01:27:10 UTC) #8
sky
LGTM, as long you come back and clean this up. I like the factory idea ...
8 years, 6 months ago (2012-06-21 17:34:06 UTC) #9
oshima
http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): http://codereview.chromium.org/10562027/diff/6003/ui/gfx/canvas.cc#newcode79 ui/gfx/canvas.cc:79: ApplyTargetScaleFactor(target_scale_factor, scale_canvas); On 2012/06/20 23:07:05, pkotwicz wrote: > It ...
8 years, 6 months ago (2012-06-21 17:47:31 UTC) #10
pkotwicz
Changes as requested. In particular, added a factory method to canvas.cc CreateCanvasWithoutScaling Thus in layer.cc, ...
8 years, 5 months ago (2012-06-25 18:02:32 UTC) #11
pkotwicz
8 years, 5 months ago (2012-06-25 18:02:47 UTC) #12
oshima
factory method look good. I'd recommend not to add new code to LGTM'ed code and ...
8 years, 5 months ago (2012-06-25 22:58:40 UTC) #13
sky
I agree. Can we land the previously LGTMd patch then clean this up? http://codereview.chromium.org/10562027/diff/24001/ui/gfx/canvas.cc File ...
8 years, 5 months ago (2012-06-25 23:42:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/31002
8 years, 5 months ago (2012-06-26 03:05:58 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/35016
8 years, 5 months ago (2012-06-26 18:41:22 UTC) #16
commit-bot: I haz the power
Try job failure for 10562027-35016 on win_rel for step "update". http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=40642 Step "update" is always ...
8 years, 5 months ago (2012-06-26 19:16:33 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/35016
8 years, 5 months ago (2012-06-26 19:19:13 UTC) #18
commit-bot: I haz the power
Try job failure for 10562027-35016 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 5 months ago (2012-06-26 20:15:06 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/41001
8 years, 5 months ago (2012-06-26 20:20:41 UTC) #20
commit-bot: I haz the power
Try job failure for 10562027-41001 (retry) on win_rel for step "interactive_ui_tests". It's a second try, ...
8 years, 5 months ago (2012-06-26 22:48:06 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/46002
8 years, 5 months ago (2012-06-26 23:22:43 UTC) #22
commit-bot: I haz the power
Try job failure for 10562027-46002 (retry) on win_rel for step "interactive_ui_tests". It's a second try, ...
8 years, 5 months ago (2012-06-27 02:12:08 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10562027/50001
8 years, 5 months ago (2012-06-27 16:58:40 UTC) #24
commit-bot: I haz the power
8 years, 5 months ago (2012-06-27 17:58:42 UTC) #25
Change committed as 144489

Powered by Google App Engine
This is Rietveld 408576698