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 <stdint.h> |
| 8 |
7 #include <sstream> | 9 #include <sstream> |
8 | 10 |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
11 #include "base/path_service.h" | 13 #include "base/path_service.h" |
12 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
14 #include "cc/debug/lap_timer.h" | 16 #include "cc/debug/lap_timer.h" |
15 #include "cc/layers/nine_patch_layer.h" | 17 #include "cc/layers/nine_patch_layer.h" |
16 #include "cc/layers/solid_color_layer.h" | 18 #include "cc/layers/solid_color_layer.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 ASSERT_TRUE(tab_contents_.get()); | 286 ASSERT_TRUE(tab_contents_.get()); |
285 } | 287 } |
286 | 288 |
287 void WillCommit() override { | 289 void WillCommit() override { |
288 if (CleanUpStarted()) | 290 if (CleanUpStarted()) |
289 return; | 291 return; |
290 gpu::Mailbox gpu_mailbox; | 292 gpu::Mailbox gpu_mailbox; |
291 std::ostringstream name_stream; | 293 std::ostringstream name_stream; |
292 name_stream << "name" << next_sync_point_; | 294 name_stream << "name" << next_sync_point_; |
293 gpu_mailbox.SetName( | 295 gpu_mailbox.SetName( |
294 reinterpret_cast<const int8*>(name_stream.str().c_str())); | 296 reinterpret_cast<const int8_t*>(name_stream.str().c_str())); |
295 scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( | 297 scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( |
296 base::Bind(&EmptyReleaseCallback)); | 298 base::Bind(&EmptyReleaseCallback)); |
297 TextureMailbox mailbox(gpu_mailbox, gpu::SyncToken(next_sync_point_), | 299 TextureMailbox mailbox(gpu_mailbox, gpu::SyncToken(next_sync_point_), |
298 GL_TEXTURE_2D); | 300 GL_TEXTURE_2D); |
299 next_sync_point_++; | 301 next_sync_point_++; |
300 | 302 |
301 tab_contents_->SetTextureMailbox(mailbox, std::move(callback)); | 303 tab_contents_->SetTextureMailbox(mailbox, std::move(callback)); |
302 } | 304 } |
303 | 305 |
304 void DidCommit() override { | 306 void DidCommit() override { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreaded) { | 342 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreaded) { |
341 begin_frame_driven_drawing_ = true; | 343 begin_frame_driven_drawing_ = true; |
342 measure_commit_cost_ = true; | 344 measure_commit_cost_ = true; |
343 SetTestName("heavy_page"); | 345 SetTestName("heavy_page"); |
344 ReadTestFile("heavy_layer_tree"); | 346 ReadTestFile("heavy_layer_tree"); |
345 RunTest(CompositorMode::Threaded, false); | 347 RunTest(CompositorMode::Threaded, false); |
346 } | 348 } |
347 | 349 |
348 } // namespace | 350 } // namespace |
349 } // namespace cc | 351 } // namespace cc |
OLD | NEW |