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

Side by Side Diff: cc/layers/texture_layer_unittest.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Actually, unittests need CC_EXPORT. Created 6 years, 8 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 | « no previous file | cc/output/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/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 return; 1176 return;
1177 1177
1178 // Return all resources immediately. 1178 // Return all resources immediately.
1179 TransferableResourceArray resources_to_return = 1179 TransferableResourceArray resources_to_return =
1180 output_surface()->resources_held_by_parent(); 1180 output_surface()->resources_held_by_parent();
1181 1181
1182 CompositorFrameAck ack; 1182 CompositorFrameAck ack;
1183 for (size_t i = 0; i < resources_to_return.size(); ++i) 1183 for (size_t i = 0; i < resources_to_return.size(); ++i)
1184 output_surface()->ReturnResource(resources_to_return[i].id, &ack); 1184 output_surface()->ReturnResource(resources_to_return[i].id, &ack);
1185 host_impl->ReclaimResources(&ack); 1185 host_impl->ReclaimResources(&ack);
1186 host_impl->OnSwapBuffersComplete();
1187 } 1186 }
1188 1187
1189 virtual void AfterTest() OVERRIDE {} 1188 virtual void AfterTest() OVERRIDE {}
1190 1189
1191 private: 1190 private:
1192 scoped_refptr<TextureLayer> texture_layer_; 1191 scoped_refptr<TextureLayer> texture_layer_;
1193 }; 1192 };
1194 1193
1195 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); 1194 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest);
1196 1195
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 return; 1315 return;
1317 1316
1318 // Return all resources immediately. 1317 // Return all resources immediately.
1319 TransferableResourceArray resources_to_return = 1318 TransferableResourceArray resources_to_return =
1320 output_surface()->resources_held_by_parent(); 1319 output_surface()->resources_held_by_parent();
1321 1320
1322 CompositorFrameAck ack; 1321 CompositorFrameAck ack;
1323 for (size_t i = 0; i < resources_to_return.size(); ++i) 1322 for (size_t i = 0; i < resources_to_return.size(); ++i)
1324 output_surface()->ReturnResource(resources_to_return[i].id, &ack); 1323 output_surface()->ReturnResource(resources_to_return[i].id, &ack);
1325 host_impl->ReclaimResources(&ack); 1324 host_impl->ReclaimResources(&ack);
1326 host_impl->OnSwapBuffersComplete();
1327 } 1325 }
1328 1326
1329 virtual void AfterTest() OVERRIDE {} 1327 virtual void AfterTest() OVERRIDE {}
1330 1328
1331 private: 1329 private:
1332 scoped_refptr<SolidColorLayer> solid_layer_; 1330 scoped_refptr<SolidColorLayer> solid_layer_;
1333 scoped_refptr<Layer> parent_layer_; 1331 scoped_refptr<Layer> parent_layer_;
1334 scoped_refptr<TextureLayer> texture_layer_; 1332 scoped_refptr<TextureLayer> texture_layer_;
1335 1333
1336 // Used on the main thread. 1334 // Used on the main thread.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 int callback_count_; 1561 int callback_count_;
1564 scoped_refptr<Layer> root_; 1562 scoped_refptr<Layer> root_;
1565 scoped_refptr<TextureLayer> layer_; 1563 scoped_refptr<TextureLayer> layer_;
1566 }; 1564 };
1567 1565
1568 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1566 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
1569 TextureLayerWithMailboxImplThreadDeleted); 1567 TextureLayerWithMailboxImplThreadDeleted);
1570 1568
1571 } // namespace 1569 } // namespace
1572 } // namespace cc 1570 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698