OLD | NEW |
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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 ReadTestFile("long_scrollable_page"); | 236 ReadTestFile("long_scrollable_page"); |
237 RunTest(false, false, false); | 237 RunTest(false, false, false); |
238 } | 238 } |
239 | 239 |
240 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePageThreadedImplSide) { | 240 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePageThreadedImplSide) { |
241 SetTestName("long_scrollable_page_threaded_impl_side"); | 241 SetTestName("long_scrollable_page_threaded_impl_side"); |
242 ReadTestFile("long_scrollable_page"); | 242 ReadTestFile("long_scrollable_page"); |
243 RunTestWithImplSidePainting(); | 243 RunTestWithImplSidePainting(); |
244 } | 244 } |
245 | 245 |
246 static void EmptyReleaseCallback(unsigned sync_point, bool lost_resource) {} | 246 static void EmptyReleaseCallback(uint32 sync_point, bool lost_resource) {} |
247 | 247 |
248 // Simulates main-thread scrolling on each frame. | 248 // Simulates main-thread scrolling on each frame. |
249 class BrowserCompositorInvalidateLayerTreePerfTest | 249 class BrowserCompositorInvalidateLayerTreePerfTest |
250 : public LayerTreeHostPerfTestJsonReader { | 250 : public LayerTreeHostPerfTestJsonReader { |
251 public: | 251 public: |
252 BrowserCompositorInvalidateLayerTreePerfTest() | 252 BrowserCompositorInvalidateLayerTreePerfTest() |
253 : next_sync_point_(1) { | 253 : next_sync_point_(1) { |
254 } | 254 } |
255 | 255 |
256 virtual void BuildTree() OVERRIDE { | 256 virtual void BuildTree() OVERRIDE { |
257 LayerTreeHostPerfTestJsonReader::BuildTree(); | 257 LayerTreeHostPerfTestJsonReader::BuildTree(); |
258 tab_contents_ = | 258 tab_contents_ = |
259 static_cast<TextureLayer*>( | 259 static_cast<TextureLayer*>( |
260 layer_tree_host()->root_layer()->children()[0]-> | 260 layer_tree_host()->root_layer()->children()[0]-> |
261 children()[0]-> | 261 children()[0]-> |
262 children()[0]-> | 262 children()[0]-> |
263 children()[0].get()); | 263 children()[0].get()); |
264 ASSERT_TRUE(tab_contents_.get()); | 264 ASSERT_TRUE(tab_contents_.get()); |
265 } | 265 } |
266 | 266 |
267 virtual void Layout() OVERRIDE { | 267 virtual void Layout() OVERRIDE { |
268 gpu::Mailbox gpu_mailbox; | 268 gpu::Mailbox gpu_mailbox; |
269 std::ostringstream name_stream; | 269 std::ostringstream name_stream; |
270 name_stream << "name" << next_sync_point_; | 270 name_stream << "name" << next_sync_point_; |
271 const char* name = name_stream.str().c_str(); | 271 const char* name = name_stream.str().c_str(); |
272 memcpy(gpu_mailbox.name, name, strlen(name) + 1); | 272 memcpy(gpu_mailbox.name, name, strlen(name) + 1); |
273 scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( | 273 scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( |
274 base::Bind(&EmptyReleaseCallback)); | 274 base::Bind(&EmptyReleaseCallback)); |
275 TextureMailbox mailbox(gpu_mailbox, next_sync_point_); | 275 TextureMailbox mailbox(gpu_mailbox, GL_TEXTURE_2D, next_sync_point_); |
276 next_sync_point_++; | 276 next_sync_point_++; |
277 | 277 |
278 tab_contents_->SetTextureMailbox(mailbox, callback.Pass()); | 278 tab_contents_->SetTextureMailbox(mailbox, callback.Pass()); |
279 } | 279 } |
280 | 280 |
281 private: | 281 private: |
282 scoped_refptr<TextureLayer> tab_contents_; | 282 scoped_refptr<TextureLayer> tab_contents_; |
283 unsigned next_sync_point_; | 283 unsigned next_sync_point_; |
284 }; | 284 }; |
285 | 285 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { | 359 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { |
360 measure_commit_cost_ = true; | 360 measure_commit_cost_ = true; |
361 SetTestName("heavy_page_page_scale"); | 361 SetTestName("heavy_page_page_scale"); |
362 ReadTestFile("heavy_layer_tree"); | 362 ReadTestFile("heavy_layer_tree"); |
363 RunTestWithImplSidePainting(); | 363 RunTestWithImplSidePainting(); |
364 } | 364 } |
365 | 365 |
366 } // namespace | 366 } // namespace |
367 } // namespace cc | 367 } // namespace cc |
OLD | NEW |