WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92182
[chromium] Turn the debug HUD into a layer so that it can be drawn as a WebCompositorQuad
https://bugs.webkit.org/show_bug.cgi?id=92182
Summary
[chromium] Turn the debug HUD into a layer so that it can be drawn as a WebCo...
Dana Jansens
Reported
2012-07-24 17:29:17 PDT
[chromium] Turn the debug HUD into a layer so that it can be drawn as a WebCompositorQuad
Attachments
Patch
(63.81 KB, patch)
2012-07-24 17:35 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(61.67 KB, patch)
2012-07-24 17:41 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(62.14 KB, patch)
2012-07-24 18:05 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(62.20 KB, patch)
2012-07-24 18:19 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
diff-to-fix-asserts
(6.45 KB, patch)
2012-07-25 10:35 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(62.88 KB, patch)
2012-07-25 10:36 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(62.87 KB, patch)
2012-07-25 10:40 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Dana Jansens
Comment 1
2012-07-24 17:35:52 PDT
Created
attachment 154193
[details]
Patch
Dana Jansens
Comment 2
2012-07-24 17:41:10 PDT
Created
attachment 154195
[details]
Patch remove the changes in CCDamageTracker by having layerPropertyChanged() return true when layerIsAlwaysDamaged(). remove the changes to turn on debug rects (oops)
Adrienne Walker
Comment 3
2012-07-24 17:57:49 PDT
Comment on
attachment 154195
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154195&action=review
> Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h:44 > + explicit HeadsUpDisplayLayerChromium();
No need for explicit here.
> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:63 > + // FIXME: Use contentBounds() for the texture.
Don't contentBounds == bounds here?
> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:92 > + printf("layerPropertyChanged %d\n", layerPropertyChanged());
Whomp.
Antoine Labour
Comment 4
2012-07-24 17:59:31 PDT
Comment on
attachment 154193
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154193&action=review
> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:83 > + resourceProvider->upload(m_hudTexture->id(), locker.pixels(), layerRect, layerRect, layerRect);
Note: FYI this will be a problem with the host compositor, similar to other uses of willDraw in CCTextureLayerImpl or CCVideoLayerImpl. Essentially when we will want to upload data to it, it will be in use by the host compositor and things will go bad. We'll have to fix it similarly to the way we'll fix the other classes, e.g. double-buffering. You don't have to change it now, but it would be useful for future reference to add an ASSERT that !resourceProvider->inUseByConsumer(m_hudTexture->id()), and a FIXME.
Dana Jansens
Comment 5
2012-07-24 18:03:12 PDT
Comment on
attachment 154193
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154193&action=review
>> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:83 >> + resourceProvider->upload(m_hudTexture->id(), locker.pixels(), layerRect, layerRect, layerRect); > > Note: FYI this will be a problem with the host compositor, similar to other uses of willDraw in CCTextureLayerImpl or CCVideoLayerImpl. Essentially when we will want to upload data to it, it will be in use by the host compositor and things will go bad. > We'll have to fix it similarly to the way we'll fix the other classes, e.g. double-buffering. You don't have to change it now, but it would be useful for future reference to add an ASSERT that !resourceProvider->inUseByConsumer(m_hudTexture->id()), and a FIXME.
ya this was intentional punting :) good idea with the assert and fixme!
Dana Jansens
Comment 6
2012-07-24 18:05:11 PDT
Comment on
attachment 154195
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154195&action=review
>> Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h:44 >> + explicit HeadsUpDisplayLayerChromium(); > > No need for explicit here.
Ah the copypaste. thanks.
>> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:63 >> + // FIXME: Use contentBounds() for the texture. > > Don't contentBounds == bounds here?
Well.. yes. Hm. I guess everything is going to get very small tho in hidpi. I will reword this FIXME.
>> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:92 >> + printf("layerPropertyChanged %d\n", layerPropertyChanged()); > > Whomp.
removed
Dana Jansens
Comment 7
2012-07-24 18:05:53 PDT
Created
attachment 154203
[details]
Patch
Adrienne Walker
Comment 8
2012-07-24 18:12:17 PDT
Comment on
attachment 154203
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154203&action=review
R=me. I love all the HUD code removal from the proxy and LRC.
> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:107 > + // parent compositor. We will probably need to hold on to m_frame for
m_frame -> m_hudTexture?
Dana Jansens
Comment 9
2012-07-24 18:13:53 PDT
Comment on
attachment 154203
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154203&action=review
Thanks
>> Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:107 >> + // parent compositor. We will probably need to hold on to m_frame for > > m_frame -> m_hudTexture?
Ya! HUD is not video.
Dana Jansens
Comment 10
2012-07-24 18:19:55 PDT
Created
attachment 154206
[details]
Patch
Dana Jansens
Comment 11
2012-07-25 10:35:03 PDT
Created
attachment 154385
[details]
diff-to-fix-asserts
Dana Jansens
Comment 12
2012-07-25 10:36:18 PDT
Created
attachment 154386
[details]
Patch
Dana Jansens
Comment 13
2012-07-25 10:40:02 PDT
Created
attachment 154388
[details]
Patch remove the explicit i added that wasnt needed
Adrienne Walker
Comment 14
2012-07-25 11:17:24 PDT
Comment on
attachment 154388
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154388&action=review
> Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp:70 > + return CCHeadsUpDisplayLayerImpl::create(m_layerId, m_fontAtlas.release());
Is there ever a time where the impl-side layer goes away and m_fontAtlas needs to be reused? In other words, maybe create m_fontAtlas if needed in an update function just to be safe?
Dana Jansens
Comment 15
2012-07-25 11:20:18 PDT
Comment on
attachment 154388
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154388&action=review
>> Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp:70 >> + return CCHeadsUpDisplayLayerImpl::create(m_layerId, m_fontAtlas.release()); > > Is there ever a time where the impl-side layer goes away and m_fontAtlas needs to be reused? In other words, maybe create m_fontAtlas if needed in an update function just to be safe?
We never delete the impl tree, and we never turn hud off, so the impl layer will always be there. In order to know if you need to make a new atlas you need to know if the impl layer has one. But we have to make the atlas before we block the impl thread. I would say that if we make a way to turn HUD off/on, then the turn-on mechanism should be the one to signal the atlas to be created. Right now creating a HUDLayerChromium is the mechanism we use to signal that the atlas needs to be created. wdyt?
Adrienne Walker
Comment 16
2012-07-25 11:22:36 PDT
Comment on
attachment 154388
[details]
Patch R=me(again). I'll buy that argument. If we make the HUD toggleable, there'll be a lot more that will need to be changed.
Shawn Singh
Comment 17
2012-07-25 11:23:51 PDT
Comment on
attachment 154388
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=154388&action=review
> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:268 > + if (m_hudLayer) > + m_hudLayer->removeFromParent();
I'm a little confused about this - does this mean we will be re-creating the hudLayer on every commit? won't that mean we are also re-creating the fontAtlas stuff that should only be done once?
Shawn Singh
Comment 18
2012-07-25 11:26:16 PDT
(In reply to
comment #17
)
> (From update of
attachment 154388
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=154388&action=review
> > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:268 > > + if (m_hudLayer) > > + m_hudLayer->removeFromParent(); > > I'm a little confused about this - does this mean we will be re-creating the hudLayer on every commit? won't that mean we are also re-creating the fontAtlas stuff that should only be done once?
I guess my comment was just 10 minutes out-dated
Adrienne Walker
Comment 19
2012-07-25 11:30:10 PDT
(In reply to
comment #17
)
> (From update of
attachment 154388
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=154388&action=review
> > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:268 > > + if (m_hudLayer) > > + m_hudLayer->removeFromParent(); > > I'm a little confused about this - does this mean we will be re-creating the hudLayer on every commit? won't that mean we are also re-creating the fontAtlas stuff that should only be done once?
Removing the hud layer from its parent doesn't clear it and cause it to be recreated. It's still owned by the CCLTH.
Dana Jansens
Comment 20
2012-07-25 12:46:41 PDT
Committed
r123644
: <
http://trac.webkit.org/changeset/123644
>
James Robinson
Comment 21
2012-07-31 15:24:09 PDT
This patch appears to have inverted all the colors (specifically swizzled red<->blue), since the old HUD shader was a swizzle shader and the texture shader doesn't swizzle. It's easy enough to "correct" for this by swizzling the colors back when we paint, since we programatically paint everything in the HUD, but it's a bit strange.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug