| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <cmath> | 6 #include <cmath> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 content::GLHelper::ScalerQuality kQualities[] = { | 47 content::GLHelper::ScalerQuality kQualities[] = { |
| 48 content::GLHelper::SCALER_QUALITY_BEST, | 48 content::GLHelper::SCALER_QUALITY_BEST, |
| 49 content::GLHelper::SCALER_QUALITY_GOOD, | 49 content::GLHelper::SCALER_QUALITY_GOOD, |
| 50 content::GLHelper::SCALER_QUALITY_FAST, }; | 50 content::GLHelper::SCALER_QUALITY_FAST, }; |
| 51 | 51 |
| 52 const char* kQualityNames[] = {"best", "good", "fast", }; | 52 const char* kQualityNames[] = {"best", "good", "fast", }; |
| 53 | 53 |
| 54 class GLHelperTest : public testing::Test { | 54 class GLHelperTest : public testing::Test { |
| 55 protected: | 55 protected: |
| 56 virtual void SetUp() { | 56 void SetUp() override { |
| 57 WebGraphicsContext3D::Attributes attributes; | 57 WebGraphicsContext3D::Attributes attributes; |
| 58 bool lose_context_when_out_of_memory = false; | 58 bool lose_context_when_out_of_memory = false; |
| 59 context_ = | 59 context_ = |
| 60 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 60 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
| 61 attributes, lose_context_when_out_of_memory); | 61 attributes, lose_context_when_out_of_memory); |
| 62 context_->InitializeOnCurrentThread(); | 62 context_->InitializeOnCurrentThread(); |
| 63 context_support_ = context_->GetContextSupport(); | 63 context_support_ = context_->GetContextSupport(); |
| 64 helper_.reset( | 64 helper_.reset( |
| 65 new content::GLHelper(context_->GetGLInterface(), context_support_)); | 65 new content::GLHelper(context_->GetGLInterface(), context_support_)); |
| 66 helper_scaling_.reset(new content::GLHelperScaling( | 66 helper_scaling_.reset(new content::GLHelperScaling( |
| 67 context_->GetGLInterface(), helper_.get())); | 67 context_->GetGLInterface(), helper_.get())); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual void TearDown() { | 70 void TearDown() override { |
| 71 helper_scaling_.reset(NULL); | 71 helper_scaling_.reset(NULL); |
| 72 helper_.reset(NULL); | 72 helper_.reset(NULL); |
| 73 context_.reset(NULL); | 73 context_.reset(NULL); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void StartTracing(const std::string& filter) { | 76 void StartTracing(const std::string& filter) { |
| 77 base::debug::TraceLog::GetInstance()->SetEnabled( | 77 base::debug::TraceLog::GetInstance()->SetEnabled( |
| 78 base::debug::CategoryFilter(filter), | 78 base::debug::CategoryFilter(filter), |
| 79 base::debug::TraceLog::RECORDING_MODE, | 79 base::debug::TraceLog::RECORDING_MODE, |
| 80 base::debug::TraceOptions( | 80 base::debug::TraceOptions( |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 base::CommandLine::Init(argc, argv); | 1958 base::CommandLine::Init(argc, argv); |
| 1959 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1959 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 1960 #if defined(OS_MACOSX) | 1960 #if defined(OS_MACOSX) |
| 1961 base::mac::ScopedNSAutoreleasePool pool; | 1961 base::mac::ScopedNSAutoreleasePool pool; |
| 1962 #endif | 1962 #endif |
| 1963 | 1963 |
| 1964 content::UnitTestTestSuite runner(suite); | 1964 content::UnitTestTestSuite runner(suite); |
| 1965 base::MessageLoop message_loop; | 1965 base::MessageLoop message_loop; |
| 1966 return runner.Run(); | 1966 return runner.Run(); |
| 1967 } | 1967 } |
| OLD | NEW |