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

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 19331002: Associate an id with the output surface to handle lost contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android, tests Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index c07ac4427559abac5fd72e891aa0041e3eca95aa..4d72863896e3332cc2573da2cca0552783692b0a 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -49,11 +49,13 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
+ uint32 output_surface_id,
WebGraphicsContext3DCommandBufferImpl* context3D,
cc::SoftwareOutputDevice* software_device,
bool use_swap_compositor_frame_message)
: OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context3D),
make_scoped_ptr(software_device)),
+ output_surface_id_(output_surface_id),
use_swap_compositor_frame_message_(use_swap_compositor_frame_message),
output_surface_filter_(
RenderThreadImpl::current()->compositor_output_surface_filter()),
@@ -101,7 +103,9 @@ bool CompositorOutputSurface::BindToClient(
void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
if (use_swap_compositor_frame_message_) {
- Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame));
+ Send(new ViewHostMsg_SwapCompositorFrame(routing_id_,
+ output_surface_id_,
+ *frame));
DidSwapBuffers();
return;
}
@@ -152,7 +156,12 @@ void CompositorOutputSurface::OnBeginFrame(const cc::BeginFrameArgs& args) {
}
#endif // defined(OS_ANDROID)
-void CompositorOutputSurface::OnSwapAck(const cc::CompositorFrameAck& ack) {
+void CompositorOutputSurface::OnSwapAck(uint32 output_surface_id,
+ const cc::CompositorFrameAck& ack) {
+ // Ignore message if it's a stale one coming from a different output surface
+ // (e.g. after a lost context).
+ if (output_surface_id != output_surface_id_)
+ return;
OnSwapBuffersComplete(&ack);
}
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/delegated_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698