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

Side by Side Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2374183006: Remove GLFrameData from CompositorFrame. (Closed)
Patch Set: Rebase. Created 4 years, 2 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/surfaces/display_unittest.cc ('k') | cc/test/fake_output_surface.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/fake_compositor_frame_sink.h" 5 #include "cc/test/fake_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
10 #include "cc/resources/returned_resource.h" 10 #include "cc/resources/returned_resource.h"
(...skipping 13 matching lines...) Expand all
24 void FakeCompositorFrameSink::SwapBuffers(CompositorFrame frame) { 24 void FakeCompositorFrameSink::SwapBuffers(CompositorFrame frame) {
25 ReturnResourcesHeldByParent(); 25 ReturnResourcesHeldByParent();
26 26
27 last_sent_frame_.reset(new CompositorFrame(std::move(frame))); 27 last_sent_frame_.reset(new CompositorFrame(std::move(frame)));
28 ++num_sent_frames_; 28 ++num_sent_frames_;
29 29
30 if (last_sent_frame_->delegated_frame_data) { 30 if (last_sent_frame_->delegated_frame_data) {
31 auto* frame_data = last_sent_frame_->delegated_frame_data.get(); 31 auto* frame_data = last_sent_frame_->delegated_frame_data.get();
32 last_swap_rect_ = frame_data->render_pass_list.back()->damage_rect; 32 last_swap_rect_ = frame_data->render_pass_list.back()->damage_rect;
33 last_swap_rect_valid_ = true; 33 last_swap_rect_valid_ = true;
34 } else if (context_provider()) {
35 last_swap_rect_ = last_sent_frame_->gl_frame_data->sub_buffer_rect;
36 last_swap_rect_valid_ = true;
37 } else { 34 } else {
38 // Unknown for direct software frames.
39 last_swap_rect_ = gfx::Rect(); 35 last_swap_rect_ = gfx::Rect();
40 last_swap_rect_valid_ = false; 36 last_swap_rect_valid_ = false;
41 } 37 }
42 38
43 if (last_sent_frame_->delegated_frame_data || !context_provider()) { 39 if (last_sent_frame_->delegated_frame_data || !context_provider()) {
44 if (last_sent_frame_->delegated_frame_data) { 40 if (last_sent_frame_->delegated_frame_data) {
45 auto* frame_data = last_sent_frame_->delegated_frame_data.get(); 41 auto* frame_data = last_sent_frame_->delegated_frame_data.get();
46 resources_held_by_parent_.insert(resources_held_by_parent_.end(), 42 resources_held_by_parent_.insert(resources_held_by_parent_.end(),
47 frame_data->resource_list.begin(), 43 frame_data->resource_list.begin(),
48 frame_data->resource_list.end()); 44 frame_data->resource_list.end());
(...skipping 24 matching lines...) Expand all
73 // Return the last frame's resources immediately. 69 // Return the last frame's resources immediately.
74 ReturnedResourceArray resources; 70 ReturnedResourceArray resources;
75 for (const auto& resource : resources_held_by_parent_) 71 for (const auto& resource : resources_held_by_parent_)
76 resources.push_back(resource.ToReturnedResource()); 72 resources.push_back(resource.ToReturnedResource());
77 resources_held_by_parent_.clear(); 73 resources_held_by_parent_.clear();
78 client_->ReclaimResources(resources); 74 client_->ReclaimResources(resources);
79 } 75 }
80 } 76 }
81 77
82 } // namespace cc 78 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/test/fake_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698