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

Issue 22911024: Fix crashes when NinePatchLayer doesn't have a resource. (Closed)

Created:
7 years, 4 months ago by ccameron
Modified:
7 years, 4 months ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org, enne (OOO), powei
Base URL:
https://chromium.googlesource.com/chromium/src.git@shadow
Visibility:
Public.

Description

Fix crashes when NinePatchLayer doesn't have a resource. First issue is that if NinePatchLayer doesn't get a ResourceId because of memory pressure, it will DCHECK. This is a valid situation -- just draw nothing (checkerboard would be okay as well). Second issue is that NinePatchLayer passes the ResourceId in for the texture in PushPropertiesTo, but does not call SetNeedsPushProperties when painting a new resource. The documentation of Layer::Update suggests that a side-effect of returning true from Layer::Update is that SetNeedsCommit will be called ont this layer, but this is not the case. BUG=133097 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=218574

Patch Set 1 #

Total comments: 4

Patch Set 2 : Incorporate review feedback #

Total comments: 2

Patch Set 3 : Incorporate review feedback #

Total comments: 1

Patch Set 4 : Move needs_push_properties_ from Update to PPT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -2 lines) Patch
M cc/layers/nine_patch_layer.cc View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
ccameron
LMK if this makes sense to you -- if it does, I can add tests ...
7 years, 4 months ago (2013-08-20 02:02:01 UTC) #1
danakj
On Mon, Aug 19, 2013 at 10:02 PM, <ccameron@chromium.org> wrote: > Reviewers: danakj, > > ...
7 years, 4 months ago (2013-08-20 02:09:40 UTC) #2
danakj
https://codereview.chromium.org/22911024/diff/1/cc/layers/nine_patch_layer.cc File cc/layers/nine_patch_layer.cc (right): https://codereview.chromium.org/22911024/diff/1/cc/layers/nine_patch_layer.cc#newcode74 cc/layers/nine_patch_layer.cc:74: SetNeedsPushProperties(); Oh, this uses prioritized texture manager so it ...
7 years, 4 months ago (2013-08-20 02:22:32 UTC) #3
aelias_OOO_until_Jul13
Note that powei@ is working on moving this layer type over to UIResource at the ...
7 years, 4 months ago (2013-08-20 02:42:42 UTC) #4
danakj
Then maybe always setting needs push props with an attached crbug (like scrollbars) is the ...
7 years, 4 months ago (2013-08-20 05:18:48 UTC) #5
ccameron
Thanks!! I've uploaded a version with an unconditional check. WRT UIResources, last I checked the ...
7 years, 4 months ago (2013-08-20 09:43:47 UTC) #6
danakj
https://codereview.chromium.org/22911024/diff/7001/cc/layers/nine_patch_layer.cc File cc/layers/nine_patch_layer.cc (right): https://codereview.chromium.org/22911024/diff/7001/cc/layers/nine_patch_layer.cc#newcode76 cc/layers/nine_patch_layer.cc:76: SetNeedsPushProperties(); Thanks, but I'd prefer if this matched the ...
7 years, 4 months ago (2013-08-20 16:48:57 UTC) #7
ccameron
Thanks!! https://codereview.chromium.org/22911024/diff/7001/cc/layers/nine_patch_layer.cc File cc/layers/nine_patch_layer.cc (right): https://codereview.chromium.org/22911024/diff/7001/cc/layers/nine_patch_layer.cc#newcode76 cc/layers/nine_patch_layer.cc:76: SetNeedsPushProperties(); On 2013/08/20 16:48:57, danakj wrote: > Thanks, ...
7 years, 4 months ago (2013-08-20 18:14:01 UTC) #8
aelias_OOO_until_Jul13
On 2013/08/20 18:14:01, ccameron1 wrote: > Thanks!! > > https://codereview.chromium.org/22911024/diff/7001/cc/layers/nine_patch_layer.cc > File cc/layers/nine_patch_layer.cc (right): > ...
7 years, 4 months ago (2013-08-20 18:17:12 UTC) #9
aelias_OOO_until_Jul13
OK, I filed http://crbug.com/276487 about the UIResource work.
7 years, 4 months ago (2013-08-20 18:17:41 UTC) #10
danakj
https://codereview.chromium.org/22911024/diff/12001/cc/layers/nine_patch_layer.cc File cc/layers/nine_patch_layer.cc (right): https://codereview.chromium.org/22911024/diff/12001/cc/layers/nine_patch_layer.cc#newcode79 cc/layers/nine_patch_layer.cc:79: needs_push_properties_ = true; Cool, just move this to the ...
7 years, 4 months ago (2013-08-20 18:18:04 UTC) #11
ccameron
Ah, good catch. Thanks!!
7 years, 4 months ago (2013-08-20 18:27:48 UTC) #12
ccameron
Ah, good catch. Thanks!!
7 years, 4 months ago (2013-08-20 18:27:49 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ccameron@chromium.org/22911024/19001
7 years, 4 months ago (2013-08-20 18:28:07 UTC) #14
commit-bot: I haz the power
7 years, 4 months ago (2013-08-20 23:42:42 UTC) #15
Message was sent while issue was closed.
Change committed as 218574

Powered by Google App Engine
This is Rietveld 408576698