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

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

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused variable Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/solid_color_layer.h" 6 #include "cc/layers/solid_color_layer.h"
7 #include "cc/layers/texture_layer.h" 7 #include "cc/layers/texture_layer.h"
8 #include "cc/output/copy_output_request.h" 8 #include "cc/output/copy_output_request.h"
9 #include "cc/output/copy_output_result.h" 9 #include "cc/output/copy_output_result.h"
10 #include "cc/test/fake_picture_layer.h" 10 #include "cc/test/fake_picture_layer.h"
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 // Cause the device scale factor to be inherited by contents scales. 924 // Cause the device scale factor to be inherited by contents scales.
925 settings->layer_transforms_should_scale_layer_contents = true; 925 settings->layer_transforms_should_scale_layer_contents = true;
926 } 926 }
927 927
928 virtual void SetupTree() OVERRIDE { 928 virtual void SetupTree() OVERRIDE {
929 layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_); 929 layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_);
930 LayerTreePixelTest::SetupTree(); 930 LayerTreePixelTest::SetupTree();
931 } 931 }
932 932
933 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { 933 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
934 LayerImpl* root_impl = host_impl->active_tree()->root_layer(); 934 LayerImpl* root_impl = host_impl->active_tree()->root_layer();
danakj 2014/09/15 16:26:35 Just remove all these layers, they're unused.
hendrikw 2014/09/15 16:59:40 Acknowledged.
935 EXPECT_EQ(device_scale_factor_,
936 host_impl->active_tree()->device_scale_factor());
935 937
936 FakePictureLayerImpl* background_impl = 938 FakePictureLayerImpl* background_impl =
937 static_cast<FakePictureLayerImpl*>(root_impl->children()[0]); 939 static_cast<FakePictureLayerImpl*>(root_impl->children()[0]);
938 EXPECT_EQ(device_scale_factor_,
939 background_impl->HighResTiling()->contents_scale());
vmpstr 2014/09/15 15:45:08 Why this change?
danakj 2014/09/15 16:26:35 This test makes solid color quads now so it has no
hendrikw 2014/09/15 16:59:40 Because we no longer have HiResTiling(), i.e. it i
940
941 FakePictureLayerImpl* green_impl = 940 FakePictureLayerImpl* green_impl =
942 static_cast<FakePictureLayerImpl*>(background_impl->children()[0]); 941 static_cast<FakePictureLayerImpl*>(background_impl->children()[0]);
943 EXPECT_EQ(device_scale_factor_,
944 green_impl->HighResTiling()->contents_scale());
945
946 FakePictureLayerImpl* blue_impl = 942 FakePictureLayerImpl* blue_impl =
947 static_cast<FakePictureLayerImpl*>(green_impl->children()[0]); 943 static_cast<FakePictureLayerImpl*>(green_impl->children()[0]);
948 EXPECT_EQ(device_scale_factor_,
949 blue_impl->HighResTiling()->contents_scale());
950 } 944 }
951 945
952 float device_scale_factor_; 946 float device_scale_factor_;
953 SolidColorContentLayerClient white_client_; 947 SolidColorContentLayerClient white_client_;
954 SolidColorContentLayerClient green_client_; 948 SolidColorContentLayerClient green_client_;
955 SolidColorContentLayerClient blue_client_; 949 SolidColorContentLayerClient blue_client_;
956 }; 950 };
957 951
958 TEST_F(LayerTreeHostReadbackDeviceScalePixelTest, 952 TEST_F(LayerTreeHostReadbackDeviceScalePixelTest,
959 ReadbackSubrect_Software) { 953 ReadbackSubrect_Software) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 background, 1088 background,
1095 green.get(), 1089 green.get(),
1096 base::FilePath(FILE_PATH_LITERAL( 1090 base::FilePath(FILE_PATH_LITERAL(
1097 "green_with_blue_corner.png"))); 1091 "green_with_blue_corner.png")));
1098 } 1092 }
1099 1093
1100 } // namespace 1094 } // namespace
1101 } // namespace cc 1095 } // namespace cc
1102 1096
1103 #endif // OS_ANDROID 1097 #endif // OS_ANDROID
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698