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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/memory/ref_counted_memory.h" | 6 #include "base/memory/ref_counted_memory.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
11 #include "content/browser/compositor/gl_helper.h" | 11 #include "content/browser/compositor/gl_helper.h" |
12 #include "gpu/command_buffer/client/gl_in_process_context.h" | 12 #include "gpu/command_buffer/client/gl_in_process_context.h" |
13 #include "gpu/command_buffer/client/gles2_implementation.h" | 13 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 14 #include "gpu/command_buffer/client/shared_memory_limits.h" |
14 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
15 #include "media/base/video_util.h" | 16 #include "media/base/video_util.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
18 #include "ui/gl/gl_implementation.h" | 19 #include "ui/gl/gl_implementation.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
(...skipping 14 matching lines...) Expand all Loading... |
38 attributes.sample_buffers = 1; | 39 attributes.sample_buffers = 1; |
39 attributes.bind_generates_resource = false; | 40 attributes.bind_generates_resource = false; |
40 | 41 |
41 context_.reset(gpu::GLInProcessContext::Create( | 42 context_.reset(gpu::GLInProcessContext::Create( |
42 nullptr, /* service */ | 43 nullptr, /* service */ |
43 nullptr, /* surface */ | 44 nullptr, /* surface */ |
44 true, /* offscreen */ | 45 true, /* offscreen */ |
45 gfx::kNullAcceleratedWidget, /* window */ | 46 gfx::kNullAcceleratedWidget, /* window */ |
46 gfx::Size(1, 1), /* size */ | 47 gfx::Size(1, 1), /* size */ |
47 nullptr, /* share_context */ | 48 nullptr, /* share_context */ |
48 attributes, gfx::PreferDiscreteGpu, | 49 attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(), |
49 ::gpu::GLInProcessContextSharedMemoryLimits(), | |
50 nullptr, /* gpu_memory_buffer_manager */ | 50 nullptr, /* gpu_memory_buffer_manager */ |
51 nullptr /* image_factory */)); | 51 nullptr /* image_factory */)); |
52 gl_ = context_->GetImplementation(); | 52 gl_ = context_->GetImplementation(); |
53 gpu::ContextSupport* support = context_->GetImplementation(); | 53 gpu::ContextSupport* support = context_->GetImplementation(); |
54 | 54 |
55 helper_.reset(new content::GLHelper(gl_, support)); | 55 helper_.reset(new content::GLHelper(gl_, support)); |
56 } | 56 } |
57 | 57 |
58 void TearDown() override { | 58 void TearDown() override { |
59 helper_.reset(NULL); | 59 helper_.reset(NULL); |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 INSTANTIATE_TEST_CASE_P( | 545 INSTANTIATE_TEST_CASE_P( |
546 , | 546 , |
547 YUVReadbackPixelTest, | 547 YUVReadbackPixelTest, |
548 ::testing::Combine( | 548 ::testing::Combine( |
549 ::testing::Bool(), | 549 ::testing::Bool(), |
550 ::testing::Bool(), | 550 ::testing::Bool(), |
551 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)), | 551 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)), |
552 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)))); | 552 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)))); |
553 | 553 |
554 } // namespace content | 554 } // namespace content |
OLD | NEW |