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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/gl/gl_context.h" | 12 #include "ui/gl/gl_context.h" |
13 #include "ui/gl/gl_gl_api_implementation.h" | 13 #include "ui/gl/gl_gl_api_implementation.h" |
14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
15 #include "ui/gl/gl_switches.h" | 15 #include "ui/gl/gl_switches.h" |
16 #include "ui/gl/gpu_timing.h" | 16 #include "ui/gl/gpu_timing.h" |
17 | 17 |
18 namespace gl { | 18 namespace gl { |
19 | 19 |
20 class GLContextFake : public GLContext { | 20 class GLContextFake : public GLContext { |
21 public: | 21 public: |
22 bool Initialize(GLSurface* compatible_surface, | 22 bool Initialize(GLSurface* compatible_surface, |
23 const GLContextAttribs& attribs) override { | 23 GpuPreference gpu_preference) override { |
24 return true; | 24 return true; |
25 } | 25 } |
26 bool MakeCurrent(GLSurface* surface) override { return true; } | 26 bool MakeCurrent(GLSurface* surface) override { return true; } |
27 void ReleaseCurrent(GLSurface* surface) override {} | 27 void ReleaseCurrent(GLSurface* surface) override {} |
28 bool IsCurrent(GLSurface* surface) override { return true; } | 28 bool IsCurrent(GLSurface* surface) override { return true; } |
29 void* GetHandle() override { return NULL; } | 29 void* GetHandle() override { return NULL; } |
30 scoped_refptr<GPUTimingClient> CreateGPUTimingClient() override { | 30 scoped_refptr<GPUTimingClient> CreateGPUTimingClient() override { |
31 return NULL; | 31 return NULL; |
32 } | 32 } |
33 void OnSetSwapInterval(int interval) override {} | 33 void OnSetSwapInterval(int interval) override {} |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 kFakeDisabledExtensions); | 211 kFakeDisabledExtensions); |
212 InitializeAPI(&command_line); | 212 InitializeAPI(&command_line); |
213 | 213 |
214 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); | 214 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); |
215 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { | 215 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { |
216 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); | 216 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 } // namespace gl | 220 } // namespace gl |
OLD | NEW |