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

Side by Side Diff: services/ui/public/cpp/lib/output_surface.cc

Issue 2147873003: cc: Dedup IPCs to return resources to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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 unified diff | Download patch
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.cc ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/ui/public/cpp/output_surface.h" 5 #include "services/ui/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"
10 #include "cc/output/output_surface_client.h" 9 #include "cc/output/output_surface_client.h"
11 #include "services/ui/public/cpp/window_surface.h" 10 #include "services/ui/public/cpp/window_surface.h"
12 11
13 namespace ui { 12 namespace ui {
14 13
15 OutputSurface::OutputSurface( 14 OutputSurface::OutputSurface(
16 const scoped_refptr<cc::ContextProvider>& context_provider, 15 const scoped_refptr<cc::ContextProvider>& context_provider,
17 std::unique_ptr<ui::WindowSurface> surface) 16 std::unique_ptr<ui::WindowSurface> surface)
18 : cc::OutputSurface(context_provider, nullptr, nullptr), 17 : cc::OutputSurface(context_provider, nullptr, nullptr),
19 surface_(std::move(surface)) { 18 surface_(std::move(surface)) {
(...skipping 29 matching lines...) Expand all
49 // destroyed then SubmitCompositorFrame's callback will never get called. 48 // destroyed then SubmitCompositorFrame's callback will never get called.
50 // Thus, base::Unretained is safe here. 49 // Thus, base::Unretained is safe here.
51 surface_->SubmitCompositorFrame( 50 surface_->SubmitCompositorFrame(
52 std::move(frame), 51 std::move(frame),
53 base::Bind(&OutputSurface::SwapBuffersComplete, base::Unretained(this))); 52 base::Bind(&OutputSurface::SwapBuffersComplete, base::Unretained(this)));
54 } 53 }
55 54
56 void OutputSurface::OnResourcesReturned( 55 void OutputSurface::OnResourcesReturned(
57 ui::WindowSurface* surface, 56 ui::WindowSurface* surface,
58 mojo::Array<cc::ReturnedResource> resources) { 57 mojo::Array<cc::ReturnedResource> resources) {
59 cc::CompositorFrameAck cfa; 58 ReclaimResources(resources.To<cc::ReturnedResourceArray>());
60 cfa.resources = resources.To<cc::ReturnedResourceArray>();
61 ReclaimResources(&cfa);
62 } 59 }
63 60
64 void OutputSurface::SwapBuffersComplete() { 61 void OutputSurface::SwapBuffersComplete() {
65 client_->DidSwapBuffersComplete(); 62 client_->DidSwapBuffersComplete();
66 } 63 }
67 64
68 } // namespace ui 65 } // namespace ui
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.cc ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698