Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: content/browser/compositor/gl_helper_unittest.cc

Issue 1898033005: Use gpu::SharedMemoryLimits for in process GL contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-limits
Patch Set: inproc-limits: webviewlimits Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « content/browser/compositor/gl_helper_benchmark.cc ('k') | content/browser/compositor/yuv_readback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698