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

Issue 581273002: Shadows: crop corner tiles instead of hiding. (Closed)

Created:
6 years, 3 months ago by hshi1
Modified:
5 years, 11 months ago
CC:
chromium-reviews, Ian Vollick, sievers+watch_chromium.org, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Shadows: crop corner tiles instead of hiding. When the shadow layer bounds is smaller than the full shadow image size, we should crop the corner tiles by reducing aperture values instead of making the shadow layer invisible. This allows shadow to draw correctly when window size is very small. BUG=415514 TEST=visually verify that window shadows are drawn correctly with very small windows. Committed: https://crrev.com/d89c83ac82fdd3ce5d66cdda341662098fe39e98 Cr-Commit-Position: refs/heads/master@{#295728}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address nits from danakj. #

Total comments: 5

Patch Set 3 : Remove useless comments. #

Patch Set 4 : Adding shadow_unittest #

Total comments: 17

Patch Set 5 : derat's comments. #

Patch Set 6 : Fix CHECK failure for shared instance init twice. #

Total comments: 14

Patch Set 7 : oshima #

Total comments: 4

Patch Set 8 : nits #

Total comments: 2

Patch Set 9 : nits from sky #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -32 lines) Patch
M ui/compositor/layer.h View 1 chunk +4 lines, -7 lines 0 comments Download
M ui/compositor/layer.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M ui/wm/core/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/wm/core/shadow.h View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/wm/core/shadow.cc View 1 2 2 chunks +13 lines, -23 lines 0 comments Download
A ui/wm/core/shadow_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +153 lines, -0 lines 2 comments Download
M ui/wm/wm.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 30 (4 generated)
hshi1
PTAL, thanks!
6 years, 3 months ago (2014-09-18 21:25:02 UTC) #2
danakj
ui/compositor LGTM https://codereview.chromium.org/581273002/diff/1/ui/wm/core/shadow.cc File ui/wm/core/shadow.cc (right): https://codereview.chromium.org/581273002/diff/1/ui/wm/core/shadow.cc#newcode175 ui/wm/core/shadow.cc:175: // Update nine-patch layer with new bitmap ...
6 years, 3 months ago (2014-09-18 21:28:18 UTC) #4
hshi1
https://codereview.chromium.org/581273002/diff/1/ui/wm/core/shadow.cc File ui/wm/core/shadow.cc (right): https://codereview.chromium.org/581273002/diff/1/ui/wm/core/shadow.cc#newcode175 ui/wm/core/shadow.cc:175: // Update nine-patch layer with new bitmap and aperture. ...
6 years, 3 months ago (2014-09-18 21:31:21 UTC) #5
danakj
LGTM https://codereview.chromium.org/581273002/diff/20001/ui/wm/core/shadow.cc File ui/wm/core/shadow.cc (right): https://codereview.chromium.org/581273002/diff/20001/ui/wm/core/shadow.cc#newcode175 ui/wm/core/shadow.cc:175: // Update nine-patch layer with new bitmap. Thanks, ...
6 years, 3 months ago (2014-09-18 21:35:30 UTC) #6
hshi1
https://codereview.chromium.org/581273002/diff/20001/ui/wm/core/shadow.cc File ui/wm/core/shadow.cc (right): https://codereview.chromium.org/581273002/diff/20001/ui/wm/core/shadow.cc#newcode175 ui/wm/core/shadow.cc:175: // Update nine-patch layer with new bitmap. On 2014/09/18 ...
6 years, 3 months ago (2014-09-18 21:37:13 UTC) #7
Daniel Erat
i'll defer to others, as i don't have any experience with the compositor nine-patch code ...
6 years, 3 months ago (2014-09-18 21:47:17 UTC) #8
hshi1
On 2014/09/18 21:47:17, Daniel Erat wrote: > would it be feasible to start a shadow_unittest.cc ...
6 years, 3 months ago (2014-09-18 21:53:50 UTC) #9
oshima
On 2014/09/18 21:53:50, hshi1 wrote: > On 2014/09/18 21:47:17, Daniel Erat wrote: > > would ...
6 years, 3 months ago (2014-09-18 22:11:33 UTC) #10
hshi1
On 2014/09/18 22:11:33, oshima wrote: > On 2014/09/18 21:53:50, hshi1 wrote: > > On 2014/09/18 ...
6 years, 3 months ago (2014-09-18 22:20:13 UTC) #11
oshima
On 2014/09/18 22:20:13, hshi1 wrote: > On 2014/09/18 22:11:33, oshima wrote: > > On 2014/09/18 ...
6 years, 3 months ago (2014-09-18 22:28:06 UTC) #12
hshi1
oshima@, derat@: I added shadow_unittest, PTAL, thanks!
6 years, 3 months ago (2014-09-19 00:17:19 UTC) #13
Daniel Erat
thanks! https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc#newcode26 ui/wm/core/shadow_unittest.cc:26: bitmap_small.allocPixels(SkImageInfo::MakeN32Premul(129, 129)); nit: mind moving these numbers into ...
6 years, 3 months ago (2014-09-19 00:28:59 UTC) #14
hshi1
https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc#newcode26 ui/wm/core/shadow_unittest.cc:26: bitmap_small.allocPixels(SkImageInfo::MakeN32Premul(129, 129)); On 2014/09/19 00:28:58, Daniel Erat wrote: > ...
6 years, 3 months ago (2014-09-19 00:41:13 UTC) #15
Daniel Erat
lgtm for tests, but please wait for oshima and sky to look at the shadow.cc ...
6 years, 3 months ago (2014-09-19 00:44:00 UTC) #16
danakj
https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc#newcode124 ui/wm/core/shadow_unittest.cc:124: EXPECT_EQ(shadow->layer()->bounds(), gfx::Rect(96, 96, 308, 308)); On 2014/09/19 00:41:13, hshi1 ...
6 years, 3 months ago (2014-09-19 00:44:38 UTC) #17
oshima
https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/60001/ui/wm/core/shadow_unittest.cc#newcode124 ui/wm/core/shadow_unittest.cc:124: EXPECT_EQ(shadow->layer()->bounds(), gfx::Rect(96, 96, 308, 308)); On 2014/09/19 00:44:38, danakj ...
6 years, 3 months ago (2014-09-19 14:24:02 UTC) #18
hshi1
https://codereview.chromium.org/581273002/diff/100001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/100001/ui/wm/core/shadow_unittest.cc#newcode20 ui/wm/core/shadow_unittest.cc:20: static const int kLargeBitmapSize = 269; On 2014/09/19 14:24:02, ...
6 years, 3 months ago (2014-09-19 14:47:35 UTC) #19
oshima
lgtm I'll leave accessor changes to you and danakj. https://codereview.chromium.org/581273002/diff/120001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/120001/ui/wm/core/shadow_unittest.cc#newcode97 ui/wm/core/shadow_unittest.cc:97: ...
6 years, 3 months ago (2014-09-19 15:09:59 UTC) #20
hshi1
https://codereview.chromium.org/581273002/diff/120001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/120001/ui/wm/core/shadow_unittest.cc#newcode97 ui/wm/core/shadow_unittest.cc:97: On 2014/09/19 15:09:59, oshima wrote: > nit: remove extra ...
6 years, 3 months ago (2014-09-19 15:13:20 UTC) #21
hshi1
ping sky@ (still need OWNER approval for ui/wm/core) thanks!
6 years, 3 months ago (2014-09-19 15:39:59 UTC) #22
sky
LGTM https://codereview.chromium.org/581273002/diff/140001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/140001/ui/wm/core/shadow_unittest.cc#newcode128 ui/wm/core/shadow_unittest.cc:128: scoped_ptr<Shadow> shadow(new Shadow()); Is there a reason you ...
6 years, 3 months ago (2014-09-19 16:11:31 UTC) #23
hshi1
https://codereview.chromium.org/581273002/diff/140001/ui/wm/core/shadow_unittest.cc File ui/wm/core/shadow_unittest.cc (right): https://codereview.chromium.org/581273002/diff/140001/ui/wm/core/shadow_unittest.cc#newcode128 ui/wm/core/shadow_unittest.cc:128: scoped_ptr<Shadow> shadow(new Shadow()); On 2014/09/19 16:11:31, sky wrote: > ...
6 years, 3 months ago (2014-09-19 16:42:52 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/581273002/160001
6 years, 3 months ago (2014-09-19 16:44:19 UTC) #26
commit-bot: I haz the power
Committed patchset #9 (id:160001) as 7eb2c0b04b3016868bb7c8f81048ba6cdf112592
6 years, 3 months ago (2014-09-19 17:39:39 UTC) #27
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/d89c83ac82fdd3ce5d66cdda341662098fe39e98 Cr-Commit-Position: refs/heads/master@{#295728}
6 years, 3 months ago (2014-09-19 17:40:35 UTC) #28
tfarina
5 years, 11 months ago (2015-01-16 19:33:39 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/581273002/diff/160001/ui/wm/core/shadow_unitt...
File ui/wm/core/shadow_unittest.cc (right):

https://codereview.chromium.org/581273002/diff/160001/ui/wm/core/shadow_unitt...
ui/wm/core/shadow_unittest.cc:111:
ui::ResourceBundle::InitSharedInstanceWithLocale(
Why do you need to initialize ResourceBundle here? If we are initializing it for
all tests in
https://chromium.googlesource.com/chromium/src/+/master/ui/wm/test/run_all_un...

https://codereview.chromium.org/581273002/diff/160001/ui/wm/core/shadow_unitt...
ui/wm/core/shadow_unittest.cc:118:
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
Why are you initializing (again) ResourceBundle in the teardown pass of the test
setup? Sorry, without knowing the context that does not look right.

Powered by Google App Engine
This is Rietveld 408576698