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

Issue 1116883002: Automatically redraw the display on resume. (Closed)

Created:
5 years, 7 months ago by etiennej
Modified:
5 years, 6 months ago
Reviewers:
jamesr
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Automatically redraw the display on resume. When resuming, automatically redraw the display with the latest known frame available. This fixes #99 and obsoletes https://codereview.chromium.org/1110423002/. The app no longer crashes on rotation after resuming. I tested with both mojo:ganesh_app and sky_viewer (home.sky and spinning_cube.sky). I didn't encounter any issue/crash with reusing frames across lost contexts with them.

Patch Set 1 #

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -7 lines) Patch
M mojo/services/gpu/public/interfaces/context_provider.mojom View 1 1 chunk +4 lines, -0 lines 1 comment Download
M services/native_viewport/onscreen_context_provider.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M services/native_viewport/onscreen_context_provider.cc View 1 1 chunk +14 lines, -3 lines 0 comments Download
M services/surfaces/display_impl.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M services/surfaces/display_impl.cc View 1 3 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
etiennej
Note: I'll be OOO for the next 3 weeks; Colin will be covering me on ...
5 years, 7 months ago (2015-04-30 10:41:21 UTC) #2
jamesr
The mojom ContextProvider interface is not specific to viewports, it can be used for any ...
5 years, 7 months ago (2015-05-01 00:15:40 UTC) #3
blundell
On 2015/05/01 00:15:40, jamesr wrote: > The mojom ContextProvider interface is not specific to viewports, ...
5 years, 7 months ago (2015-05-04 14:14:06 UTC) #4
blundell
5 years, 7 months ago (2015-05-04 15:11:14 UTC) #5
On 2015/05/04 14:14:06, blundell wrote:
> On 2015/05/01 00:15:40, jamesr wrote:
> > The mojom ContextProvider interface is not specific to viewports, it can be
> used
> > for any situation where the contexts need to be associated with some state. 
> > This sort of callback should be on NativeViewport
> > 
> >
>
https://codereview.chromium.org/1116883002/diff/20001/mojo/services/gpu/publi...
> > File mojo/services/gpu/public/interfaces/context_provider.mojom (right):
> > 
> >
>
https://codereview.chromium.org/1116883002/diff/20001/mojo/services/gpu/publi...
> > mojo/services/gpu/public/interfaces/context_provider.mojom:29: // The
callback
> > for this method will be called when a new viewport is
> > this shouldn't be needed - the callback to Create() will be called when a
new
> > buffer is created, won't it?
> 
> Hi James,
> 
> I started looking into this issue today. The answer to your second question is
> no: the callback to Create() is not called is because that callback was reset
in
> the previous call to CreateAndReturnCommandBuffer(). For that reason,
> OnscreenContextProvider does not even create a new command buffer when it gets
> the call to |SetAcceleratedWidget()| with a non-null widget on resumption from
> backgrounding.
> 
> Here is what the flow is with this CL patched in: OnscreenContextProvider
calls
> DisplayImpl::OnViewportCreated. The latter calls Draw(), which fails with
error
> messages about the context being lost and results in a callback to
> DisplayImpl::OutputSurfaceLost(). *That* call results in
> OnscreenContextProvider::Create() being called, and the actual successful draw
> then happens in the callback from that method to
> DisplayImpl::OnContextCreated().
> 
> It seems to me that the root problem is that OnscreenContextProvider knows
when
> the context has gone away from its end (i.e., when
> OnscreenContextProvider::SetAcceleratedWidget(nullptr) is called), but it
> doesn't inform the client that had asked it to create that context. I'm
thinking
> that a solution is to create a ContextLossObserver interface in
> context_provider.mojom and pass a |ContextLossObserver?| to
> ContextProvider::Create(). OnscreenContextProvider will call this observer
when
> the context has gone away and then reset it. DisplayImpl will set up a
> ContextLossObserver that calls back to DisplayImpl::OutputSurfaceLost, which
> will then result in OnscreenContextProvider creating and returning a new
command
> buffer when it can do so (i.e., when |SetAcceleratedWidget() is called again
> with a non-null value).
> 
> Does this seem like a reasonable approach to you, or are there other
directions
> that you think we should be looking in?

qsr@ helped me realize that most of the flow I'm talking about already exists;
it just needed to be kicked off.

Let's continue discussion on https://codereview.chromium.org/1123623003/.

Powered by Google App Engine
This is Rietveld 408576698