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

Side by Side Diff: components/mus/public/cpp/lib/output_surface.cc

Issue 2019833002: Implement StructTraits for various cc and gpu types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mailbox_name by ref to make windows happy Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/public/cpp/output_surface.h" 5 #include "components/mus/public/cpp/output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_ack.h" 9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
(...skipping 29 matching lines...) Expand all
40 // OutputSurface owns WindowSurface, and so if OutputSurface is 40 // OutputSurface owns WindowSurface, and so if OutputSurface is
41 // destroyed then SubmitCompositorFrame's callback will never get called. 41 // destroyed then SubmitCompositorFrame's callback will never get called.
42 // Thus, base::Unretained is safe here. 42 // Thus, base::Unretained is safe here.
43 surface_->SubmitCompositorFrame( 43 surface_->SubmitCompositorFrame(
44 mojom::CompositorFrame::From(*frame), 44 mojom::CompositorFrame::From(*frame),
45 base::Bind(&OutputSurface::SwapBuffersComplete, base::Unretained(this))); 45 base::Bind(&OutputSurface::SwapBuffersComplete, base::Unretained(this)));
46 } 46 }
47 47
48 void OutputSurface::OnResourcesReturned( 48 void OutputSurface::OnResourcesReturned(
49 mus::WindowSurface* surface, 49 mus::WindowSurface* surface,
50 mojo::Array<mojom::ReturnedResourcePtr> resources) { 50 mojo::Array<cc::ReturnedResource> resources) {
51 cc::CompositorFrameAck cfa; 51 cc::CompositorFrameAck cfa;
52 cfa.resources = resources.To<cc::ReturnedResourceArray>(); 52 cfa.resources = resources.To<cc::ReturnedResourceArray>();
53 ReclaimResources(&cfa); 53 ReclaimResources(&cfa);
54 } 54 }
55 55
56 void OutputSurface::SwapBuffersComplete() { 56 void OutputSurface::SwapBuffersComplete() {
57 client_->DidSwapBuffersComplete(); 57 client_->DidSwapBuffersComplete();
58 } 58 }
59 59
60 } // namespace mus 60 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gpu/display_compositor/compositor_frame_sink_impl.cc ('k') | components/mus/public/cpp/lib/window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698