| 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 "ui/gl/gpu_timing.h" | 5 #include "ui/gl/gpu_timing.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void SetUp() override { | 32 void SetUp() override { |
| 33 setup_ = false; | 33 setup_ = false; |
| 34 cpu_time_bounded_ = false; | 34 cpu_time_bounded_ = false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void TearDown() override { | 37 void TearDown() override { |
| 38 context_ = nullptr; | 38 context_ = nullptr; |
| 39 surface_ = nullptr; | 39 surface_ = nullptr; |
| 40 if (setup_) { | 40 if (setup_) { |
| 41 MockGLInterface::SetGLInterface(NULL); | 41 MockGLInterface::SetGLInterface(NULL); |
| 42 init::ClearGLBindings(); | 42 init::ShutdownGL(); |
| 43 } | 43 } |
| 44 setup_ = false; | 44 setup_ = false; |
| 45 cpu_time_bounded_ = false; | 45 cpu_time_bounded_ = false; |
| 46 gl_.reset(); | 46 gl_.reset(); |
| 47 gpu_timing_fake_queries_.Reset(); | 47 gpu_timing_fake_queries_.Reset(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void SetupGLContext(const char* gl_version, const char* gl_extensions) { | 50 void SetupGLContext(const char* gl_version, const char* gl_extensions) { |
| 51 ASSERT_FALSE(setup_) << "Cannot setup GL context twice."; | 51 ASSERT_FALSE(setup_) << "Cannot setup GL context twice."; |
| 52 SetGLGetProcAddressProc(MockGLInterface::GetGLProcAddress); | 52 SetGLGetProcAddressProc(MockGLInterface::GetGLProcAddress); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 int64_t start, end; | 209 int64_t start, end; |
| 210 gpu_timer->GetStartEndTimestamps(&start, &end); | 210 gpu_timer->GetStartEndTimestamps(&start, &end); |
| 211 // Force time elapsed won't be set until a query is actually attempted | 211 // Force time elapsed won't be set until a query is actually attempted |
| 212 ASSERT_TRUE(client->IsForceTimeElapsedQuery()); | 212 ASSERT_TRUE(client->IsForceTimeElapsedQuery()); |
| 213 EXPECT_EQ(begin_cpu_time, start); | 213 EXPECT_EQ(begin_cpu_time, start); |
| 214 EXPECT_EQ(begin_cpu_time, end); | 214 EXPECT_EQ(begin_cpu_time, end); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace gl | 217 } // namespace gl |
| OLD | NEW |