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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.h » ('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 "cc/surfaces/surface.h" 5 #include "cc/surfaces/surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
11 #include "cc/surfaces/surface_factory.h" 11 #include "cc/surfaces/surface_factory.h"
12 #include "cc/surfaces/surface_id_allocator.h" 12 #include "cc/surfaces/surface_id_allocator.h"
13 #include "cc/surfaces/surface_manager.h" 13 #include "cc/surfaces/surface_manager.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 // The frame index starts at 2 so that empty frames will be treated as 17 // The frame index starts at 2 so that empty frames will be treated as
18 // completely damaged the first time they're drawn from. 18 // completely damaged the first time they're drawn from.
19 static const int kFrameIndexStart = 2; 19 static const int kFrameIndexStart = 2;
20 20
21 Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory) 21 Surface::Surface(SurfaceId id, SurfaceFactory* factory)
22 : surface_id_(id), 22 : surface_id_(id),
23 size_(size),
24 factory_(factory->AsWeakPtr()), 23 factory_(factory->AsWeakPtr()),
25 frame_index_(kFrameIndexStart) { 24 frame_index_(kFrameIndexStart) {
26 } 25 }
27 26
28 Surface::~Surface() { 27 Surface::~Surface() {
29 ClearCopyRequests(); 28 ClearCopyRequests();
30 if (current_frame_ && factory_) { 29 if (current_frame_ && factory_) {
31 ReturnedResourceArray current_resources; 30 ReturnedResourceArray current_resources;
32 TransferableResource::ReturnResources( 31 TransferableResource::ReturnResources(
33 current_frame_->delegated_frame_data->resource_list, 32 current_frame_->delegated_frame_data->resource_list,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (current_frame_) { 129 if (current_frame_) {
131 for (const auto& render_pass : 130 for (const auto& render_pass :
132 current_frame_->delegated_frame_data->render_pass_list) { 131 current_frame_->delegated_frame_data->render_pass_list) {
133 for (const auto& copy_request : render_pass->copy_requests) 132 for (const auto& copy_request : render_pass->copy_requests)
134 copy_request->SendEmptyResult(); 133 copy_request->SendEmptyResult();
135 } 134 }
136 } 135 }
137 } 136 }
138 137
139 } // namespace cc 138 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698