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

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

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « cc/scheduler/scheduler_state_machine.h ('k') | cc/surfaces/surface_display_output_surface.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 "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"
(...skipping 28 matching lines...) Expand all
39 39
40 void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame, 40 void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
41 const DrawCallback& callback) { 41 const DrawCallback& callback) {
42 DCHECK(factory_); 42 DCHECK(factory_);
43 ClearCopyRequests(); 43 ClearCopyRequests();
44 TakeLatencyInfo(&frame->metadata.latency_info); 44 TakeLatencyInfo(&frame->metadata.latency_info);
45 scoped_ptr<CompositorFrame> previous_frame = current_frame_.Pass(); 45 scoped_ptr<CompositorFrame> previous_frame = current_frame_.Pass();
46 current_frame_ = frame.Pass(); 46 current_frame_ = frame.Pass();
47 factory_->ReceiveFromChild( 47 factory_->ReceiveFromChild(
48 current_frame_->delegated_frame_data->resource_list); 48 current_frame_->delegated_frame_data->resource_list);
49 ++frame_index_; 49 // Empty frames shouldn't be drawn and shouldn't contribute damage, so don't
50 // increment frame index for them.
51 if (!current_frame_ ||
52 !current_frame_->delegated_frame_data->render_pass_list.empty())
53 ++frame_index_;
50 54
51 if (previous_frame) { 55 if (previous_frame) {
52 ReturnedResourceArray previous_resources; 56 ReturnedResourceArray previous_resources;
53 TransferableResource::ReturnResources( 57 TransferableResource::ReturnResources(
54 previous_frame->delegated_frame_data->resource_list, 58 previous_frame->delegated_frame_data->resource_list,
55 &previous_resources); 59 &previous_resources);
56 factory_->UnrefResources(previous_resources); 60 factory_->UnrefResources(previous_resources);
57 } 61 }
58 if (!draw_callback_.is_null()) 62 if (!draw_callback_.is_null())
59 draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED); 63 draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (current_frame_) { 135 if (current_frame_) {
132 for (const auto& render_pass : 136 for (const auto& render_pass :
133 current_frame_->delegated_frame_data->render_pass_list) { 137 current_frame_->delegated_frame_data->render_pass_list) {
134 for (const auto& copy_request : render_pass->copy_requests) 138 for (const auto& copy_request : render_pass->copy_requests)
135 copy_request->SendEmptyResult(); 139 copy_request->SendEmptyResult();
136 } 140 }
137 } 141 }
138 } 142 }
139 143
140 } // namespace cc 144 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/surfaces/surface_display_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698