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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 10797055: gpu in-memory program cache implementation with a memory limit + lru eviction. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: nit fixes Created 8 years, 5 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
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/tests/gl_manager.h"
6
7 #include <vector>
8
5 #include "base/at_exit.h" 9 #include "base/at_exit.h"
6 #include "base/bind.h" 10 #include "base/bind.h"
7 #include "gpu/command_buffer/client/gles2_implementation.h" 11 #include "gpu/command_buffer/client/gles2_implementation.h"
8 #include "gpu/command_buffer/client/gles2_lib.h" 12 #include "gpu/command_buffer/client/gles2_lib.h"
9 #include "gpu/command_buffer/client/transfer_buffer.h" 13 #include "gpu/command_buffer/client/transfer_buffer.h"
10 #include "gpu/command_buffer/common/constants.h" 14 #include "gpu/command_buffer/common/constants.h"
11 #include "gpu/command_buffer/service/command_buffer_service.h" 15 #include "gpu/command_buffer/service/command_buffer_service.h"
12 #include "gpu/command_buffer/service/context_group.h" 16 #include "gpu/command_buffer/service/context_group.h"
13 #include "gpu/command_buffer/service/gpu_scheduler.h" 17 #include "gpu/command_buffer/service/gpu_scheduler.h"
14 #include "gpu/command_buffer/service/mailbox_manager.h" 18 #include "gpu/command_buffer/service/mailbox_manager.h"
15 #include "gpu/command_buffer/tests/gl_manager.h"
16 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gl/gl_context.h" 20 #include "ui/gl/gl_context.h"
18 #include "ui/gl/gl_share_group.h" 21 #include "ui/gl/gl_share_group.h"
19 #include "ui/gl/gl_surface.h" 22 #include "ui/gl/gl_surface.h"
20 23
21 namespace gpu { 24 namespace gpu {
22 25
23 GLManager::GLManager() { 26 GLManager::GLManager() {
24 } 27 }
25 28
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 attribs.push_back(8); 90 attribs.push_back(8);
88 attribs.push_back(EGL_BLUE_SIZE); 91 attribs.push_back(EGL_BLUE_SIZE);
89 attribs.push_back(8); 92 attribs.push_back(8);
90 attribs.push_back(EGL_ALPHA_SIZE); 93 attribs.push_back(EGL_ALPHA_SIZE);
91 attribs.push_back(8); 94 attribs.push_back(8);
92 attribs.push_back(EGL_DEPTH_SIZE); 95 attribs.push_back(EGL_DEPTH_SIZE);
93 attribs.push_back(16); 96 attribs.push_back(16);
94 attribs.push_back(EGL_NONE); 97 attribs.push_back(EGL_NONE);
95 98
96 if (!context_group) { 99 if (!context_group) {
97 context_group = new gles2::ContextGroup( 100 context_group = new gles2::ContextGroup(mailbox_manager_.get(),
98 mailbox_manager_.get(), kBindGeneratesResource); 101 kBindGeneratesResource);
99 } 102 }
100 103
101 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); 104 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group));
102 105
103 command_buffer_.reset(new CommandBufferService( 106 command_buffer_.reset(new CommandBufferService(
104 decoder_->GetContextGroup()->transfer_buffer_manager())); 107 decoder_->GetContextGroup()->transfer_buffer_manager()));
105 ASSERT_TRUE(command_buffer_->Initialize()) 108 ASSERT_TRUE(command_buffer_->Initialize())
106 << "could not create command buffer service"; 109 << "could not create command buffer service";
107 110
108 gpu_scheduler_.reset(new GpuScheduler(command_buffer_.get(), 111 gpu_scheduler_.reset(new GpuScheduler(command_buffer_.get(),
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 ::gpu::CommandBuffer::State state = command_buffer_->GetState(); 187 ::gpu::CommandBuffer::State state = command_buffer_->GetState();
185 ASSERT_EQ(::gpu::error::kNoError, state.error); 188 ASSERT_EQ(::gpu::error::kNoError, state.error);
186 } 189 }
187 190
188 bool GLManager::GetBufferChanged(int32 transfer_buffer_id) { 191 bool GLManager::GetBufferChanged(int32 transfer_buffer_id) {
189 return gpu_scheduler_->SetGetBuffer(transfer_buffer_id); 192 return gpu_scheduler_->SetGetBuffer(transfer_buffer_id);
190 } 193 }
191 194
192 } // namespace gpu 195 } // namespace gpu
193 196
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698