OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
9 #include "cc/raster/texture_compressor.h" | 9 #include "cc/raster/texture_compressor.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } while (!timer_.HasTimeLimitExpired()); | 70 } while (!timer_.HasTimeLimitExpired()); |
71 | 71 |
72 TextureCompressor::Format format = ::testing::get<1>(GetParam()); | 72 TextureCompressor::Format format = ::testing::get<1>(GetParam()); |
73 std::string str = FormatName(format) + " " + QualityName(quality); | 73 std::string str = FormatName(format) + " " + QualityName(quality); |
74 perf_test::PrintResult("Compress256x256", name, str, timer_.MsPerLap(), | 74 perf_test::PrintResult("Compress256x256", name, str, timer_.MsPerLap(), |
75 "us", true); | 75 "us", true); |
76 } | 76 } |
77 | 77 |
78 protected: | 78 protected: |
79 LapTimer timer_; | 79 LapTimer timer_; |
80 scoped_ptr<TextureCompressor> compressor_; | 80 std::unique_ptr<TextureCompressor> compressor_; |
81 uint8_t src_[kImageSizeInBytes]; | 81 uint8_t src_[kImageSizeInBytes]; |
82 uint8_t dst_[kImageSizeInBytes]; | 82 uint8_t dst_[kImageSizeInBytes]; |
83 }; | 83 }; |
84 | 84 |
85 TEST_P(TextureCompressorPerfTest, Compress256x256BlackAndWhiteGradientImage) { | 85 TEST_P(TextureCompressorPerfTest, Compress256x256BlackAndWhiteGradientImage) { |
86 for (int i = 0; i < kImageSizeInBytes; ++i) | 86 for (int i = 0; i < kImageSizeInBytes; ++i) |
87 src_[i] = i % 256; | 87 src_[i] = i % 256; |
88 | 88 |
89 RunTest("BlackAndWhiteGradientImage"); | 89 RunTest("BlackAndWhiteGradientImage"); |
90 } | 90 } |
(...skipping 23 matching lines...) Expand all Loading... |
114 INSTANTIATE_TEST_CASE_P( | 114 INSTANTIATE_TEST_CASE_P( |
115 TextureCompressorPerfTests, | 115 TextureCompressorPerfTests, |
116 TextureCompressorPerfTest, | 116 TextureCompressorPerfTest, |
117 ::testing::Combine(::testing::Values(TextureCompressor::kQualityLow, | 117 ::testing::Combine(::testing::Values(TextureCompressor::kQualityLow, |
118 TextureCompressor::kQualityMedium, | 118 TextureCompressor::kQualityMedium, |
119 TextureCompressor::kQualityHigh), | 119 TextureCompressor::kQualityHigh), |
120 ::testing::Values(TextureCompressor::kFormatETC1))); | 120 ::testing::Values(TextureCompressor::kFormatETC1))); |
121 | 121 |
122 } // namespace | 122 } // namespace |
123 } // namespace cc | 123 } // namespace cc |
OLD | NEW |