| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 attributes.sample_buffers = 1; | 66 attributes.sample_buffers = 1; |
| 67 attributes.bind_generates_resource = false; | 67 attributes.bind_generates_resource = false; |
| 68 | 68 |
| 69 context_.reset(gpu::GLInProcessContext::Create( | 69 context_.reset(gpu::GLInProcessContext::Create( |
| 70 nullptr, /* service */ | 70 nullptr, /* service */ |
| 71 nullptr, /* surface */ | 71 nullptr, /* surface */ |
| 72 true, /* offscreen */ | 72 true, /* offscreen */ |
| 73 gfx::kNullAcceleratedWidget, /* window */ | 73 gfx::kNullAcceleratedWidget, /* window */ |
| 74 gfx::Size(1, 1), /* size */ | 74 gfx::Size(1, 1), /* size */ |
| 75 nullptr, /* share_context */ | 75 nullptr, /* share_context */ |
| 76 attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(), | 76 attributes, gl::PreferDiscreteGpu, gpu::SharedMemoryLimits(), |
| 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 display_compositor::GLHelper(gl_, support)); | 82 helper_.reset(new display_compositor::GLHelper(gl_, support)); |
| 83 helper_scaling_.reset( | 83 helper_scaling_.reset( |
| 84 new display_compositor::GLHelperScaling(gl_, helper_.get())); | 84 new display_compositor::GLHelperScaling(gl_, helper_.get())); |
| 85 } | 85 } |
| 86 | 86 |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 std::unique_ptr<gpu::GLInProcessContext> context_; | 1261 std::unique_ptr<gpu::GLInProcessContext> context_; |
| 1262 gpu::gles2::GLES2Interface* gl_; | 1262 gpu::gles2::GLES2Interface* gl_; |
| 1263 std::unique_ptr<display_compositor::GLHelper> helper_; | 1263 std::unique_ptr<display_compositor::GLHelper> helper_; |
| 1264 std::unique_ptr<display_compositor::GLHelperScaling> helper_scaling_; | 1264 std::unique_ptr<display_compositor::GLHelperScaling> helper_scaling_; |
| 1265 std::deque<GLHelperScaling::ScaleOp> x_ops_, y_ops_; | 1265 std::deque<GLHelperScaling::ScaleOp> x_ops_, y_ops_; |
| 1266 base::MessageLoop message_loop_; | 1266 base::MessageLoop message_loop_; |
| 1267 }; | 1267 }; |
| 1268 | 1268 |
| 1269 class GLHelperPixelTest : public GLHelperTest { | 1269 class GLHelperPixelTest : public GLHelperTest { |
| 1270 private: | 1270 private: |
| 1271 gfx::DisableNullDrawGLBindings enable_pixel_output_; | 1271 gl::DisableNullDrawGLBindings enable_pixel_output_; |
| 1272 }; | 1272 }; |
| 1273 | 1273 |
| 1274 TEST_F(GLHelperTest, RGBASyncReadbackTest) { | 1274 TEST_F(GLHelperTest, RGBASyncReadbackTest) { |
| 1275 const int kTestSize = 64; | 1275 const int kTestSize = 64; |
| 1276 bool result = TestTextureFormatReadback(gfx::Size(kTestSize, kTestSize), | 1276 bool result = TestTextureFormatReadback(gfx::Size(kTestSize, kTestSize), |
| 1277 kRGBA_8888_SkColorType, false); | 1277 kRGBA_8888_SkColorType, false); |
| 1278 EXPECT_EQ(result, true); | 1278 EXPECT_EQ(result, true); |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 TEST_F(GLHelperTest, BGRASyncReadbackTest) { | 1281 TEST_F(GLHelperTest, BGRASyncReadbackTest) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 } | 1429 } |
| 1430 } | 1430 } |
| 1431 } | 1431 } |
| 1432 | 1432 |
| 1433 TEST_F(GLHelperTest, CheckOptimizations) { | 1433 TEST_F(GLHelperTest, CheckOptimizations) { |
| 1434 // Test in baseclass since it is friends with GLHelperScaling | 1434 // Test in baseclass since it is friends with GLHelperScaling |
| 1435 CheckOptimizationsTest(); | 1435 CheckOptimizationsTest(); |
| 1436 } | 1436 } |
| 1437 | 1437 |
| 1438 } // namespace display_compositor | 1438 } // namespace display_compositor |
| OLD | NEW |