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

Issue 900063002: Fixes for two different HUD issues related to win32k lockdown (Closed)

Created:
5 years, 10 months ago by scottmg
Modified:
5 years, 10 months ago
Reviewers:
danakj, enne (OOO), piman
CC:
cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixes for two different HUD issues related to win32k lockdown 1. Using a GDI bitmap -- switch to SkSurface instead 2. Lazily loading a font. This breaks for two different reasons. The first is a DCHECK for doing IO on the Compositor thread. This could have been just ignored in general since it's only for debug usage, the drawbacks of minor jank are limited. However, once lockdown is on, the font load hard fails from the renderer. So, load the typeface before lockdown and pass it into CC and the hud via LayerTreeSettings. R=danakj@chromium.org BUG=453731, 455104 TEST=run chrome with --enable-win32k-renderer-lockdown --show-fps-counter --ui-show-fps-counter on Win8 Committed: https://crrev.com/616a8e656b2d923ed393bde86adc150e555ba799 Cr-Commit-Position: refs/heads/master@{#314929}

Patch Set 1 #

Patch Set 2 : i am a plumber #

Total comments: 7

Patch Set 3 : fixes #

Patch Set 4 : fix on non-win #

Patch Set 5 : move to ui/gfx/hud_font.h/cc #

Patch Set 6 : gn for real #

Total comments: 2

Patch Set 7 : refptr #

Total comments: 5

Patch Set 8 : no #if, so browser gets a reasonable font #

Total comments: 2

Patch Set 9 : better adoptref #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -21 lines) Patch
M cc/layers/heads_up_display_layer_impl.h View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M cc/layers/heads_up_display_layer_impl.cc View 1 2 4 chunks +16 lines, -17 lines 0 comments Download
M cc/trees/layer_tree_settings.h View 1 2 4 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/renderer_main_platform_delegate_win.cc View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -1 line 1 comment Download
M ui/compositor/compositor.cc View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M ui/gfx/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/gfx.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A ui/gfx/hud_font.h View 1 2 3 4 5 6 1 chunk +20 lines, -0 lines 0 comments Download
A ui/gfx/hud_font.cc View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 49 (19 generated)
scottmg
Is there a better way to get that SkTypeface* through?
5 years, 10 months ago (2015-02-05 01:25:16 UTC) #5
enne (OOO)
Thanks for this! Sorry for all the plumbing. https://codereview.chromium.org/900063002/diff/80001/cc/layers/heads_up_display_layer_impl.h File cc/layers/heads_up_display_layer_impl.h (right): https://codereview.chromium.org/900063002/diff/80001/cc/layers/heads_up_display_layer_impl.h#newcode134 cc/layers/heads_up_display_layer_impl.h:134: SkCanvas* ...
5 years, 10 months ago (2015-02-05 01:30:28 UTC) #7
scottmg
Thanks! https://codereview.chromium.org/900063002/diff/80001/cc/layers/heads_up_display_layer_impl.h File cc/layers/heads_up_display_layer_impl.h (right): https://codereview.chromium.org/900063002/diff/80001/cc/layers/heads_up_display_layer_impl.h#newcode134 cc/layers/heads_up_display_layer_impl.h:134: SkCanvas* hud_canvas_; On 2015/02/05 01:30:28, enne wrote: > ...
5 years, 10 months ago (2015-02-05 03:28:32 UTC) #12
enne (OOO)
lgtm https://codereview.chromium.org/900063002/diff/80001/cc/trees/layer_tree_host_client.h File cc/trees/layer_tree_host_client.h (right): https://codereview.chromium.org/900063002/diff/80001/cc/trees/layer_tree_host_client.h#newcode67 cc/trees/layer_tree_host_client.h:67: virtual SkTypeface* GetHudTypeface() = 0; On 2015/02/05 01:30:28, ...
5 years, 10 months ago (2015-02-05 17:54:44 UTC) #13
enne (OOO)
^ oh code review tool publishing stale comments when I hit the lgtm button
5 years, 10 months ago (2015-02-05 18:07:12 UTC) #14
scottmg
On 2015/02/05 17:54:44, enne wrote: > lgtm > > https://codereview.chromium.org/900063002/diff/80001/cc/trees/layer_tree_host_client.h > File cc/trees/layer_tree_host_client.h (right): > ...
5 years, 10 months ago (2015-02-05 18:12:30 UTC) #15
scottmg
On 2015/02/05 18:07:12, enne wrote: > ^ oh code review tool publishing stale comments when ...
5 years, 10 months ago (2015-02-05 18:16:15 UTC) #16
scottmg
Moved the font to ui/gfx/hud_font.cc/h instead for android webview. +danakj for ui/ OWNERS +piman content/ ...
5 years, 10 months ago (2015-02-05 20:52:43 UTC) #21
scottmg
Moved the font to ui/gfx/hud_font.cc/h instead for android webview. +danakj for ui/ OWNERS +piman content/ ...
5 years, 10 months ago (2015-02-05 20:53:07 UTC) #23
piman
lgtm
5 years, 10 months ago (2015-02-05 21:34:38 UTC) #24
danakj
https://codereview.chromium.org/900063002/diff/290001/ui/gfx/hud_font.h File ui/gfx/hud_font.h (right): https://codereview.chromium.org/900063002/diff/290001/ui/gfx/hud_font.h#newcode16 ui/gfx/hud_font.h:16: GFX_EXPORT void SetHudTypeface(SkTypeface* typeface); Can you use skia::RefPtr instead ...
5 years, 10 months ago (2015-02-05 21:40:43 UTC) #25
scottmg
https://codereview.chromium.org/900063002/diff/290001/ui/gfx/hud_font.h File ui/gfx/hud_font.h (right): https://codereview.chromium.org/900063002/diff/290001/ui/gfx/hud_font.h#newcode16 ui/gfx/hud_font.h:16: GFX_EXPORT void SetHudTypeface(SkTypeface* typeface); On 2015/02/05 21:40:42, danakj wrote: ...
5 years, 10 months ago (2015-02-05 22:50:42 UTC) #27
danakj
LGTM https://codereview.chromium.org/900063002/diff/310001/ui/gfx/hud_font.cc File ui/gfx/hud_font.cc (right): https://codereview.chromium.org/900063002/diff/310001/ui/gfx/hud_font.cc#newcode21 ui/gfx/hud_font.cc:21: #if !defined(OS_WIN) can we do like #if defined(OS_WIN) ...
5 years, 10 months ago (2015-02-05 22:56:14 UTC) #28
danakj
https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc#newcode60 content/renderer/renderer_main_platform_delegate_win.cc:60: SkTypeface* typeface = bonus points for doing the AdoptRef ...
5 years, 10 months ago (2015-02-05 22:56:47 UTC) #29
scottmg
https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc#newcode60 content/renderer/renderer_main_platform_delegate_win.cc:60: SkTypeface* typeface = On 2015/02/05 22:56:47, danakj wrote: > ...
5 years, 10 months ago (2015-02-05 23:21:57 UTC) #30
danakj
https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc#newcode60 content/renderer/renderer_main_platform_delegate_win.cc:60: SkTypeface* typeface = On 2015/02/05 23:21:57, scottmg wrote: > ...
5 years, 10 months ago (2015-02-05 23:24:11 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/900063002/310001
5 years, 10 months ago (2015-02-05 23:24:39 UTC) #33
danakj
On 2015/02/05 23:21:57, scottmg wrote: > https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc > File content/renderer/renderer_main_platform_delegate_win.cc (right): > > https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc#newcode60 > ...
5 years, 10 months ago (2015-02-05 23:25:07 UTC) #34
scottmg
On 2015/02/05 23:25:07, danakj wrote: > On 2015/02/05 23:21:57, scottmg wrote: > > > https://codereview.chromium.org/900063002/diff/310001/content/renderer/renderer_main_platform_delegate_win.cc ...
5 years, 10 months ago (2015-02-05 23:33:26 UTC) #36
danakj
https://codereview.chromium.org/900063002/diff/330001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/330001/content/renderer/renderer_main_platform_delegate_win.cc#newcode68 content/renderer/renderer_main_platform_delegate_win.cc:68: ui::SetHudTypeface(skia::AdoptRef(typeface)); Thanks, that looks good. Still curious how doing ...
5 years, 10 months ago (2015-02-05 23:43:41 UTC) #38
scottmg
https://codereview.chromium.org/900063002/diff/330001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/330001/content/renderer/renderer_main_platform_delegate_win.cc#newcode68 content/renderer/renderer_main_platform_delegate_win.cc:68: ui::SetHudTypeface(skia::AdoptRef(typeface)); On 2015/02/05 23:43:40, danakj wrote: > Thanks, that ...
5 years, 10 months ago (2015-02-05 23:47:55 UTC) #39
danakj
Thanks! LGTM! https://codereview.chromium.org/900063002/diff/350001/content/renderer/renderer_main_platform_delegate_win.cc File content/renderer/renderer_main_platform_delegate_win.cc (right): https://codereview.chromium.org/900063002/diff/350001/content/renderer/renderer_main_platform_delegate_win.cc#newcode65 content/renderer/renderer_main_platform_delegate_win.cc:65: skia::RefPtr<SkTypeface> hud_typeface = OH! I failed to ...
5 years, 10 months ago (2015-02-05 23:49:47 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/900063002/350001
5 years, 10 months ago (2015-02-05 23:54:36 UTC) #42
commit-bot: I haz the power
Committed patchset #9 (id:350001)
5 years, 10 months ago (2015-02-06 00:52:43 UTC) #43
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/616a8e656b2d923ed393bde86adc150e555ba799 Cr-Commit-Position: refs/heads/master@{#314929}
5 years, 10 months ago (2015-02-06 00:53:43 UTC) #44
scottmg
A revert of this CL (patchset #9 id:350001) has been created in https://codereview.chromium.org/922293006/ by scottmg@chromium.org. ...
5 years, 10 months ago (2015-02-23 16:41:14 UTC) #45
danakj
> 1. Using a GDI bitmap -- switch to SkSurface instead We should def split ...
5 years, 10 months ago (2015-02-23 17:42:20 UTC) #46
scottmg
On 2015/02/23 17:42:20, danakj wrote: > > 1. Using a GDI bitmap -- switch to ...
5 years, 10 months ago (2015-02-23 17:55:08 UTC) #47
enne (OOO)
I'm assuming the cold start regression is because the font is created every time instead ...
5 years, 10 months ago (2015-02-23 18:11:03 UTC) #48
scottmg
5 years, 10 months ago (2015-02-23 18:14:59 UTC) #49
Message was sent while issue was closed.
On 2015/02/23 18:11:03, enne wrote:
> I'm assuming the cold start regression is because the font is created every
time
> instead of just when the HUD gets turned on?  Is the answer to do something
more
> like your original patch where for non-Win platforms it gets created lazily?

Yeah, I guess that must be it. I wasn't able to repro the regression locally.

I was thinking of replacing the LayerTreeSettings `skia::RefPtr<SkTypeface>
hud_typeface` with `skia::RefPtr<SkTypeface> (*get_hud_typeface)()`, where
that's pre-created only on Windows. Does that seem OK?

> 
> Alternatively, is there another font that's already loaded that we could use
> instead?

I don't know of one.

Powered by Google App Engine
This is Rietveld 408576698