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

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

Issue 465673003: Add callback when queueing frame on Surface to create backpressure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surfaces_pixeltest.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/output/compositor_frame.h" 5 #include "cc/output/compositor_frame.h"
6 #include "cc/output/delegated_frame_data.h" 6 #include "cc/output/delegated_frame_data.h"
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_factory.h" 8 #include "cc/surfaces/surface_factory.h"
9 #include "cc/surfaces/surface_factory_client.h" 9 #include "cc/surfaces/surface_factory_client.h"
10 #include "cc/surfaces/surface_manager.h" 10 #include "cc/surfaces/surface_manager.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 size_t num_resource_ids) { 49 size_t num_resource_ids) {
50 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); 50 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
51 for (size_t i = 0u; i < num_resource_ids; ++i) { 51 for (size_t i = 0u; i < num_resource_ids; ++i) {
52 TransferableResource resource; 52 TransferableResource resource;
53 resource.id = resource_ids[i]; 53 resource.id = resource_ids[i];
54 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; 54 resource.mailbox_holder.texture_target = GL_TEXTURE_2D;
55 frame_data->resource_list.push_back(resource); 55 frame_data->resource_list.push_back(resource);
56 } 56 }
57 scoped_ptr<CompositorFrame> frame(new CompositorFrame); 57 scoped_ptr<CompositorFrame> frame(new CompositorFrame);
58 frame->delegated_frame_data = frame_data.Pass(); 58 frame->delegated_frame_data = frame_data.Pass();
59 factory_.SubmitFrame(surface_id_, frame.Pass()); 59 factory_.SubmitFrame(surface_id_, frame.Pass(), base::Closure());
60 } 60 }
61 61
62 void UnrefResources(ResourceProvider::ResourceId* ids_to_unref, 62 void UnrefResources(ResourceProvider::ResourceId* ids_to_unref,
63 int* counts_to_unref, 63 int* counts_to_unref,
64 size_t num_ids_to_unref) { 64 size_t num_ids_to_unref) {
65 ReturnedResourceArray unref_array; 65 ReturnedResourceArray unref_array;
66 for (size_t i = 0; i < num_ids_to_unref; ++i) { 66 for (size_t i = 0; i < num_ids_to_unref; ++i) {
67 ReturnedResource resource; 67 ReturnedResource resource;
68 resource.id = ids_to_unref[i]; 68 resource.id = ids_to_unref[i];
69 resource.count = counts_to_unref[i]; 69 resource.count = counts_to_unref[i];
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 ResourceProvider::ResourceId expected_returned_ids[] = {12, 13}; 351 ResourceProvider::ResourceId expected_returned_ids[] = {12, 13};
352 int expected_returned_counts[] = {2, 2}; 352 int expected_returned_counts[] = {2, 2};
353 CheckReturnedResourcesMatchExpected(expected_returned_ids, 353 CheckReturnedResourcesMatchExpected(expected_returned_ids,
354 expected_returned_counts, 354 expected_returned_counts,
355 arraysize(expected_returned_counts)); 355 arraysize(expected_returned_counts));
356 } 356 }
357 } 357 }
358 358
359 } // namespace 359 } // namespace
360 } // namespace cc 360 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surfaces_pixeltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698