| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // This file looks like a unit test, but it contains benchmarks and test | 5 // This file looks like a unit test, but it contains benchmarks and test |
| 6 // utilities intended for manual evaluation of the scalers in | 6 // utilities intended for manual evaluation of the scalers in |
| 7 // gl_helper*. These tests produce output in the form of files and printouts, | 7 // gl_helper*. These tests produce output in the form of files and printouts, |
| 8 // but cannot really "fail". There is no point in making these tests part | 8 // but cannot really "fail". There is no point in making these tests part |
| 9 // of any test automation run. | 9 // of any test automation run. |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "ui/gl/gl_surface.h" | 35 #include "ui/gl/gl_surface.h" |
| 36 | 36 |
| 37 namespace content { | 37 namespace content { |
| 38 | 38 |
| 39 content::GLHelper::ScalerQuality kQualities[] = { | 39 content::GLHelper::ScalerQuality kQualities[] = { |
| 40 content::GLHelper::SCALER_QUALITY_BEST, | 40 content::GLHelper::SCALER_QUALITY_BEST, |
| 41 content::GLHelper::SCALER_QUALITY_GOOD, | 41 content::GLHelper::SCALER_QUALITY_GOOD, |
| 42 content::GLHelper::SCALER_QUALITY_FAST, | 42 content::GLHelper::SCALER_QUALITY_FAST, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 const char* kQualityNames[] = { | 45 const char* const kQualityNames[] = { |
| 46 "best", "good", "fast", | 46 "best", "good", "fast", |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class GLHelperTest : public testing::Test { | 49 class GLHelperTest : public testing::Test { |
| 50 protected: | 50 protected: |
| 51 void SetUp() override { | 51 void SetUp() override { |
| 52 gpu::gles2::ContextCreationAttribHelper attributes; | 52 gpu::gles2::ContextCreationAttribHelper attributes; |
| 53 attributes.alpha_size = 8; | 53 attributes.alpha_size = 8; |
| 54 attributes.depth_size = 24; | 54 attributes.depth_size = 24; |
| 55 attributes.red_size = 8; | 55 attributes.red_size = 8; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", | 237 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", |
| 238 kQualityNames[q], percents[p]); | 238 kQualityNames[q], percents[p]); |
| 239 VLOG(0) << "Writing " << filename; | 239 VLOG(0) << "Writing " << filename; |
| 240 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); | 240 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 gl_->DeleteTextures(1, &src_texture); | 243 gl_->DeleteTextures(1, &src_texture); |
| 244 gl_->DeleteFramebuffers(1, &framebuffer); | 244 gl_->DeleteFramebuffers(1, &framebuffer); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace | 247 } // namespace content |
| OLD | NEW |