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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2128633002: cc: Set up the framework to restrict access to Layer internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move out the inner struct. Created 4 years, 5 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 | « cc/test/layer_internals_for_test.cc ('k') | cc/trees/tree_synchronizer_unittest.cc » ('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 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 27 matching lines...) Expand all
38 #include "cc/test/fake_layer_tree_host_client.h" 38 #include "cc/test/fake_layer_tree_host_client.h"
39 #include "cc/test/fake_output_surface.h" 39 #include "cc/test/fake_output_surface.h"
40 #include "cc/test/fake_painted_scrollbar_layer.h" 40 #include "cc/test/fake_painted_scrollbar_layer.h"
41 #include "cc/test/fake_picture_layer.h" 41 #include "cc/test/fake_picture_layer.h"
42 #include "cc/test/fake_picture_layer_impl.h" 42 #include "cc/test/fake_picture_layer_impl.h"
43 #include "cc/test/fake_proxy.h" 43 #include "cc/test/fake_proxy.h"
44 #include "cc/test/fake_recording_source.h" 44 #include "cc/test/fake_recording_source.h"
45 #include "cc/test/fake_scoped_ui_resource.h" 45 #include "cc/test/fake_scoped_ui_resource.h"
46 #include "cc/test/fake_video_frame_provider.h" 46 #include "cc/test/fake_video_frame_provider.h"
47 #include "cc/test/geometry_test_utils.h" 47 #include "cc/test/geometry_test_utils.h"
48 #include "cc/test/layer_internals_for_test.h"
48 #include "cc/test/layer_tree_test.h" 49 #include "cc/test/layer_tree_test.h"
49 #include "cc/test/test_shared_bitmap_manager.h" 50 #include "cc/test/test_shared_bitmap_manager.h"
50 #include "cc/test/test_web_graphics_context_3d.h" 51 #include "cc/test/test_web_graphics_context_3d.h"
51 #include "cc/trees/layer_tree_host_impl.h" 52 #include "cc/trees/layer_tree_host_impl.h"
52 #include "cc/trees/layer_tree_impl.h" 53 #include "cc/trees/layer_tree_impl.h"
53 #include "cc/trees/single_thread_proxy.h" 54 #include "cc/trees/single_thread_proxy.h"
54 #include "gpu/GLES2/gl2extchromium.h" 55 #include "gpu/GLES2/gl2extchromium.h"
55 #include "testing/gmock/include/gmock/gmock.h" 56 #include "testing/gmock/include/gmock/gmock.h"
56 #include "third_party/khronos/GLES2/gl2.h" 57 #include "third_party/khronos/GLES2/gl2.h"
57 #include "third_party/khronos/GLES2/gl2ext.h" 58 #include "third_party/khronos/GLES2/gl2ext.h"
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 layer_tree_host()->SetRootLayer(root_); 1110 layer_tree_host()->SetRootLayer(root_);
1110 LayerTreeHostTest::SetupTree(); 1111 LayerTreeHostTest::SetupTree();
1111 } 1112 }
1112 1113
1113 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 1114 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
1114 1115
1115 void DidCommit() override { 1116 void DidCommit() override {
1116 if (layer_tree_host()->source_frame_number() == 1) { 1117 if (layer_tree_host()->source_frame_number() == 1) {
1117 gfx::Transform scale; 1118 gfx::Transform scale;
1118 scale.Scale(2.0, 2.0); 1119 scale.Scale(2.0, 2.0);
1119 child_->OnTransformAnimated(scale); 1120 LayerInternalsForTest(child_.get()).OnTransformAnimated(scale);
1120 } 1121 }
1121 } 1122 }
1122 1123
1123 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 1124 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
1124 if (impl->sync_tree()->source_frame_number() == 0) 1125 if (impl->sync_tree()->source_frame_number() == 0)
1125 PostSetNeedsCommitToMainThread(); 1126 PostSetNeedsCommitToMainThread();
1126 } 1127 }
1127 1128
1128 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, 1129 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl,
1129 LayerTreeHostImpl::FrameData* frame_data, 1130 LayerTreeHostImpl::FrameData* frame_data,
(...skipping 5561 matching lines...) Expand 10 before | Expand all | Expand 10 after
6691 EndTest(); 6692 EndTest();
6692 } 6693 }
6693 6694
6694 void AfterTest() override {} 6695 void AfterTest() override {}
6695 }; 6696 };
6696 6697
6697 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6698 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6698 6699
6699 } // namespace 6700 } // namespace
6700 } // namespace cc 6701 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_internals_for_test.cc ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698