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

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: rebase 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') | cc/scheduler/scheduler_state_machine.h » ('J')
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 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 return; 1800 return;
1801 1801
1802 // Return all resources immediately. 1802 // Return all resources immediately.
1803 TransferableResourceArray resources_to_return = 1803 TransferableResourceArray resources_to_return =
1804 output_surface()->resources_held_by_parent(); 1804 output_surface()->resources_held_by_parent();
1805 1805
1806 CompositorFrameAck ack; 1806 CompositorFrameAck ack;
1807 for (size_t i = 0; i < resources_to_return.size(); ++i) 1807 for (size_t i = 0; i < resources_to_return.size(); ++i)
1808 output_surface()->ReturnResource(resources_to_return[i].id, &ack); 1808 output_surface()->ReturnResource(resources_to_return[i].id, &ack);
1809 host_impl->ReclaimResources(&ack); 1809 host_impl->ReclaimResources(&ack);
1810 host_impl->OnSwapBuffersComplete();
1811 } 1810 }
1812 1811
1813 virtual void AfterTest() OVERRIDE {} 1812 virtual void AfterTest() OVERRIDE {}
1814 1813
1815 private: 1814 private:
1816 scoped_refptr<TextureLayer> texture_layer_; 1815 scoped_refptr<TextureLayer> texture_layer_;
1817 }; 1816 };
1818 1817
1819 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); 1818 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest);
1820 1819
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 return; 1944 return;
1946 1945
1947 // Return all resources immediately. 1946 // Return all resources immediately.
1948 TransferableResourceArray resources_to_return = 1947 TransferableResourceArray resources_to_return =
1949 output_surface()->resources_held_by_parent(); 1948 output_surface()->resources_held_by_parent();
1950 1949
1951 CompositorFrameAck ack; 1950 CompositorFrameAck ack;
1952 for (size_t i = 0; i < resources_to_return.size(); ++i) 1951 for (size_t i = 0; i < resources_to_return.size(); ++i)
1953 output_surface()->ReturnResource(resources_to_return[i].id, &ack); 1952 output_surface()->ReturnResource(resources_to_return[i].id, &ack);
1954 host_impl->ReclaimResources(&ack); 1953 host_impl->ReclaimResources(&ack);
1955 host_impl->OnSwapBuffersComplete();
1956 } 1954 }
1957 1955
1958 virtual void AfterTest() OVERRIDE {} 1956 virtual void AfterTest() OVERRIDE {}
1959 1957
1960 private: 1958 private:
1961 scoped_refptr<SolidColorLayer> solid_layer_; 1959 scoped_refptr<SolidColorLayer> solid_layer_;
1962 scoped_refptr<Layer> parent_layer_; 1960 scoped_refptr<Layer> parent_layer_;
1963 scoped_refptr<TextureLayer> texture_layer_; 1961 scoped_refptr<TextureLayer> texture_layer_;
1964 1962
1965 // Used on the main thread. 1963 // Used on the main thread.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 int callback_count_; 2269 int callback_count_;
2272 scoped_refptr<Layer> root_; 2270 scoped_refptr<Layer> root_;
2273 scoped_refptr<TextureLayer> layer_; 2271 scoped_refptr<TextureLayer> layer_;
2274 }; 2272 };
2275 2273
2276 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 2274 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
2277 TextureLayerWithMailboxImplThreadDeleted); 2275 TextureLayerWithMailboxImplThreadDeleted);
2278 2276
2279 } // namespace 2277 } // namespace
2280 } // namespace cc 2278 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/output_surface.h » ('j') | cc/scheduler/scheduler_state_machine.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698