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

Side by Side Diff: cc/surfaces/surface.cc

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "cc/surfaces/surface.h" 5 #include "cc/surfaces/surface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/output/copy_output_request.h" 8 #include "cc/output/copy_output_request.h"
9 #include "cc/surfaces/surface_factory.h" 9 #include "cc/surfaces/surface_factory.h"
10 #include "cc/surfaces/surface_id_allocator.h"
10 #include "cc/surfaces/surface_manager.h" 11 #include "cc/surfaces/surface_manager.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 // The frame index starts at 2 so that empty frames will be treated as 15 // The frame index starts at 2 so that empty frames will be treated as
15 // completely damaged the first time they're drawn from. 16 // completely damaged the first time they're drawn from.
16 static const int kFrameIndexStart = 2; 17 static const int kFrameIndexStart = 2;
17 18
18 Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory) 19 Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory)
19 : surface_id_(id), 20 : surface_id_(id),
(...skipping 28 matching lines...) Expand all
48 ReturnedResourceArray previous_resources; 49 ReturnedResourceArray previous_resources;
49 TransferableResource::ReturnResources( 50 TransferableResource::ReturnResources(
50 previous_frame->delegated_frame_data->resource_list, 51 previous_frame->delegated_frame_data->resource_list,
51 &previous_resources); 52 &previous_resources);
52 factory_->UnrefResources(previous_resources); 53 factory_->UnrefResources(previous_resources);
53 } 54 }
54 if (!draw_callback_.is_null()) 55 if (!draw_callback_.is_null())
55 draw_callback_.Run(); 56 draw_callback_.Run();
56 draw_callback_ = callback; 57 draw_callback_ = callback;
57 factory_->manager()->DidSatisfySequences( 58 factory_->manager()->DidSatisfySequences(
58 surface_id_, &current_frame_->metadata.satisfies_sequences); 59 SurfaceIdAllocator::NamespaceForId(surface_id_),
60 &current_frame_->metadata.satisfies_sequences);
59 } 61 }
60 62
61 void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) { 63 void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) {
62 if (current_frame_ && 64 if (current_frame_ &&
63 !current_frame_->delegated_frame_data->render_pass_list.empty()) 65 !current_frame_->delegated_frame_data->render_pass_list.empty())
64 current_frame_->delegated_frame_data->render_pass_list.back() 66 current_frame_->delegated_frame_data->render_pass_list.back()
65 ->copy_requests.push_back(copy_request.Pass()); 67 ->copy_requests.push_back(copy_request.Pass());
66 else 68 else
67 copy_request->SendEmptyResult(); 69 copy_request->SendEmptyResult();
68 } 70 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (current_frame_) { 115 if (current_frame_) {
114 for (auto* render_pass : 116 for (auto* render_pass :
115 current_frame_->delegated_frame_data->render_pass_list) { 117 current_frame_->delegated_frame_data->render_pass_list) {
116 for (auto* copy_request : render_pass->copy_requests) 118 for (auto* copy_request : render_pass->copy_requests)
117 copy_request->SendEmptyResult(); 119 copy_request->SendEmptyResult();
118 } 120 }
119 } 121 }
120 } 122 }
121 123
122 } // namespace cc 124 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698