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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <cmath> | 9 #include <cmath> |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "base/synchronization/waitable_event.h" | 27 #include "base/synchronization/waitable_event.h" |
28 #include "base/test/launcher/unit_test_launcher.h" | 28 #include "base/test/launcher/unit_test_launcher.h" |
29 #include "base/test/test_suite.h" | 29 #include "base/test/test_suite.h" |
30 #include "base/time/time.h" | 30 #include "base/time/time.h" |
31 #include "base/trace_event/trace_event.h" | 31 #include "base/trace_event/trace_event.h" |
32 #include "content/browser/compositor/gl_helper.h" | 32 #include "content/browser/compositor/gl_helper.h" |
33 #include "content/browser/compositor/gl_helper_readback_support.h" | 33 #include "content/browser/compositor/gl_helper_readback_support.h" |
34 #include "content/browser/compositor/gl_helper_scaling.h" | 34 #include "content/browser/compositor/gl_helper_scaling.h" |
35 #include "gpu/command_buffer/client/gl_in_process_context.h" | 35 #include "gpu/command_buffer/client/gl_in_process_context.h" |
36 #include "gpu/command_buffer/client/gles2_implementation.h" | 36 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 37 #include "gpu/command_buffer/client/shared_memory_limits.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
38 #include "third_party/skia/include/core/SkBitmap.h" | 39 #include "third_party/skia/include/core/SkBitmap.h" |
39 #include "third_party/skia/include/core/SkTypes.h" | 40 #include "third_party/skia/include/core/SkTypes.h" |
40 #include "ui/gl/gl_implementation.h" | 41 #include "ui/gl/gl_implementation.h" |
41 | 42 |
42 namespace content { | 43 namespace content { |
43 | 44 |
44 content::GLHelper::ScalerQuality kQualities[] = { | 45 content::GLHelper::ScalerQuality kQualities[] = { |
45 content::GLHelper::SCALER_QUALITY_BEST, | 46 content::GLHelper::SCALER_QUALITY_BEST, |
46 content::GLHelper::SCALER_QUALITY_GOOD, | 47 content::GLHelper::SCALER_QUALITY_GOOD, |
(...skipping 18 matching lines...) Expand all Loading... |
65 attributes.sample_buffers = 1; | 66 attributes.sample_buffers = 1; |
66 attributes.bind_generates_resource = false; | 67 attributes.bind_generates_resource = false; |
67 | 68 |
68 context_.reset(gpu::GLInProcessContext::Create( | 69 context_.reset(gpu::GLInProcessContext::Create( |
69 nullptr, /* service */ | 70 nullptr, /* service */ |
70 nullptr, /* surface */ | 71 nullptr, /* surface */ |
71 true, /* offscreen */ | 72 true, /* offscreen */ |
72 gfx::kNullAcceleratedWidget, /* window */ | 73 gfx::kNullAcceleratedWidget, /* window */ |
73 gfx::Size(1, 1), /* size */ | 74 gfx::Size(1, 1), /* size */ |
74 nullptr, /* share_context */ | 75 nullptr, /* share_context */ |
75 attributes, gfx::PreferDiscreteGpu, | 76 attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(), |
76 ::gpu::GLInProcessContextSharedMemoryLimits(), | |
77 nullptr, /* gpu_memory_buffer_manager */ | 77 nullptr, /* gpu_memory_buffer_manager */ |
78 nullptr /* image_factory */)); | 78 nullptr /* image_factory */)); |
79 gl_ = context_->GetImplementation(); | 79 gl_ = context_->GetImplementation(); |
80 gpu::ContextSupport* support = context_->GetImplementation(); | 80 gpu::ContextSupport* support = context_->GetImplementation(); |
81 | 81 |
82 helper_.reset(new content::GLHelper(gl_, support)); | 82 helper_.reset(new content::GLHelper(gl_, support)); |
83 helper_scaling_.reset(new content::GLHelperScaling(gl_, helper_.get())); | 83 helper_scaling_.reset(new content::GLHelperScaling(gl_, helper_.get())); |
84 } | 84 } |
85 | 85 |
86 void TearDown() override { | 86 void TearDown() override { |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 } | 1430 } |
1431 } | 1431 } |
1432 } | 1432 } |
1433 | 1433 |
1434 TEST_F(GLHelperTest, CheckOptimizations) { | 1434 TEST_F(GLHelperTest, CheckOptimizations) { |
1435 // Test in baseclass since it is friends with GLHelperScaling | 1435 // Test in baseclass since it is friends with GLHelperScaling |
1436 CheckOptimizationsTest(); | 1436 CheckOptimizationsTest(); |
1437 } | 1437 } |
1438 | 1438 |
1439 } // namespace content | 1439 } // namespace content |
OLD | NEW |