| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 4990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5001 recording->SetPlaybackAllowedEvent(&playback_allowed_event_); | 5001 recording->SetPlaybackAllowedEvent(&playback_allowed_event_); |
| 5002 scoped_refptr<FakePictureLayer> layer = | 5002 scoped_refptr<FakePictureLayer> layer = |
| 5003 FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, | 5003 FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, |
| 5004 recording.Pass()); | 5004 recording.Pass()); |
| 5005 layer->SetBounds(gfx::Size(500, 500)); | 5005 layer->SetBounds(gfx::Size(500, 500)); |
| 5006 layer->SetContentsOpaque(true); | 5006 layer->SetContentsOpaque(true); |
| 5007 // Avoid LCD text on the layer so we don't cause extra commits when we | 5007 // Avoid LCD text on the layer so we don't cause extra commits when we |
| 5008 // pinch. | 5008 // pinch. |
| 5009 pinch->AddChild(layer); | 5009 pinch->AddChild(layer); |
| 5010 | 5010 |
| 5011 layer_tree_host()->RegisterViewportLayers(NULL, root, pinch, pinch); | 5011 layer_tree_host()->RegisterViewportLayers(NULL, root, pinch, nullptr); |
| 5012 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); | 5012 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); |
| 5013 layer_tree_host()->SetRootLayer(root); | 5013 layer_tree_host()->SetRootLayer(root); |
| 5014 LayerTreeHostTest::SetupTree(); | 5014 LayerTreeHostTest::SetupTree(); |
| 5015 } | 5015 } |
| 5016 | 5016 |
| 5017 // Returns the delta scale of all quads in the frame's root pass from their | 5017 // Returns the delta scale of all quads in the frame's root pass from their |
| 5018 // ideal, or 0 if they are not all the same. | 5018 // ideal, or 0 if they are not all the same. |
| 5019 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { | 5019 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { |
| 5020 if (frame_data->has_no_damage) | 5020 if (frame_data->has_no_damage) |
| 5021 return 0.f; | 5021 return 0.f; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5300 recording->SetPlaybackAllowedEvent(&playback_allowed_event_); | 5300 recording->SetPlaybackAllowedEvent(&playback_allowed_event_); |
| 5301 scoped_refptr<FakePictureLayer> layer = | 5301 scoped_refptr<FakePictureLayer> layer = |
| 5302 FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, | 5302 FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, |
| 5303 recording.Pass()); | 5303 recording.Pass()); |
| 5304 layer->SetBounds(gfx::Size(500, 500)); | 5304 layer->SetBounds(gfx::Size(500, 500)); |
| 5305 layer->SetContentsOpaque(true); | 5305 layer->SetContentsOpaque(true); |
| 5306 // Avoid LCD text on the layer so we don't cause extra commits when we | 5306 // Avoid LCD text on the layer so we don't cause extra commits when we |
| 5307 // pinch. | 5307 // pinch. |
| 5308 pinch->AddChild(layer); | 5308 pinch->AddChild(layer); |
| 5309 | 5309 |
| 5310 layer_tree_host()->RegisterViewportLayers(NULL, root, pinch, pinch); | 5310 layer_tree_host()->RegisterViewportLayers(NULL, root, pinch, nullptr); |
| 5311 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); | 5311 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); |
| 5312 layer_tree_host()->SetRootLayer(root); | 5312 layer_tree_host()->SetRootLayer(root); |
| 5313 LayerTreeHostTest::SetupTree(); | 5313 LayerTreeHostTest::SetupTree(); |
| 5314 } | 5314 } |
| 5315 | 5315 |
| 5316 // Returns the delta scale of all quads in the frame's root pass from their | 5316 // Returns the delta scale of all quads in the frame's root pass from their |
| 5317 // ideal, or 0 if they are not all the same. | 5317 // ideal, or 0 if they are not all the same. |
| 5318 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { | 5318 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { |
| 5319 if (frame_data->has_no_damage) | 5319 if (frame_data->has_no_damage) |
| 5320 return 0.f; | 5320 return 0.f; |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6331 EndTest(); | 6331 EndTest(); |
| 6332 } | 6332 } |
| 6333 | 6333 |
| 6334 void AfterTest() override {} | 6334 void AfterTest() override {} |
| 6335 }; | 6335 }; |
| 6336 | 6336 |
| 6337 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); | 6337 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); |
| 6338 | 6338 |
| 6339 } // namespace | 6339 } // namespace |
| 6340 } // namespace cc | 6340 } // namespace cc |
| OLD | NEW |