OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include <stdio.h> | |
6 #include <cmath> | |
7 #include <string> | |
8 #include <vector> | |
9 | |
10 #include "gpu/command_buffer/client/gl_in_process_context.h" | |
11 #include "gpu/command_buffer/client/gles2_implementation.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | |
13 #include "ui/gl/gl_surface.h" | |
14 | |
15 namespace { | |
16 | |
17 class ContextTestBase : public testing::Test { | |
18 public: | |
19 void SetUp() override { | |
20 gpu::gles2::ContextCreationAttribHelper attributes; | |
21 attributes.alpha_size = 8; | |
22 attributes.depth_size = 24; | |
23 attributes.red_size = 8; | |
24 attributes.green_size = 8; | |
25 attributes.blue_size = 8; | |
26 attributes.stencil_size = 8; | |
27 attributes.samples = 4; | |
28 attributes.sample_buffers = 1; | |
29 attributes.bind_generates_resource = false; | |
30 | |
31 context_.reset(gpu::GLInProcessContext::Create( | |
32 nullptr, /* service */ | |
33 nullptr, /* surface */ | |
34 true, /* offscreen */ | |
35 gfx::kNullAcceleratedWidget, /* window */ | |
36 gfx::Size(1, 1), /* size */ | |
37 nullptr, /* share_context */ | |
38 attributes, gfx::PreferDiscreteGpu, | |
39 ::gpu::GLInProcessContextSharedMemoryLimits(), | |
40 nullptr, /* gpu_memory_buffer_manager */ | |
41 nullptr /* image_factory */)); | |
42 gl_ = context_->GetImplementation(); | |
43 context_support_ = context_->GetImplementation(); | |
44 } | |
45 | |
46 void TearDown() override { context_.reset(NULL); } | |
47 | |
48 protected: | |
49 gpu::gles2::GLES2Interface* gl_; | |
50 gpu::ContextSupport* context_support_; | |
51 | |
52 private: | |
53 std::unique_ptr<gpu::GLInProcessContext> context_; | |
54 }; | |
55 | |
56 } // namespace | |
57 | |
58 // Include the actual tests. | |
59 #define CONTEXT_TEST_F TEST_F | |
60 #include "content/common/gpu/client/gpu_context_tests.h" | |
OLD | NEW |