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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: solid in-memory implementation Created 8 years, 6 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 (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/service/gles2_cmd_decoder_unittest_base.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/weak_ptr.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "gpu/command_buffer/common/gl_mock.h" 12 #include "gpu/command_buffer/common/gl_mock.h"
12 #include "gpu/command_buffer/common/gles2_cmd_format.h" 13 #include "gpu/command_buffer/common/gles2_cmd_format.h"
13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 14 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
14 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 15 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
15 #include "gpu/command_buffer/service/context_group.h" 16 #include "gpu/command_buffer/service/context_group.h"
16 #include "gpu/command_buffer/service/program_manager.h" 17 #include "gpu/command_buffer/service/program_manager.h"
17 #include "gpu/command_buffer/service/test_helper.h" 18 #include "gpu/command_buffer/service/test_helper.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 #include "ui/gl/gl_implementation.h" 20 #include "ui/gl/gl_implementation.h"
20 21
21 using ::gfx::MockGLInterface; 22 using ::gfx::MockGLInterface;
22 using ::testing::_; 23 using ::testing::_;
23 using ::testing::DoAll; 24 using ::testing::DoAll;
24 using ::testing::InSequence; 25 using ::testing::InSequence;
25 using ::testing::MatcherCast; 26 using ::testing::MatcherCast;
26 using ::testing::Pointee; 27 using ::testing::Pointee;
27 using ::testing::Return; 28 using ::testing::Return;
28 using ::testing::SetArrayArgument; 29 using ::testing::SetArrayArgument;
29 using ::testing::SetArgPointee; 30 using ::testing::SetArgPointee;
30 using ::testing::SetArgumentPointee; 31 using ::testing::SetArgumentPointee;
31 using ::testing::StrEq; 32 using ::testing::StrEq;
32 using ::testing::StrictMock; 33 using ::testing::StrictMock;
33 34
34 namespace gpu { 35 namespace gpu {
35 namespace gles2 { 36 namespace gles2 {
37 class ProgramCache;
36 38
37 GLES2DecoderTestBase::GLES2DecoderTestBase() 39 GLES2DecoderTestBase::GLES2DecoderTestBase()
38 : surface_(NULL), 40 : surface_(NULL),
39 context_(NULL), 41 context_(NULL),
40 client_buffer_id_(100), 42 client_buffer_id_(100),
41 client_framebuffer_id_(101), 43 client_framebuffer_id_(101),
42 client_program_id_(102), 44 client_program_id_(102),
43 client_renderbuffer_id_(103), 45 client_renderbuffer_id_(103),
44 client_shader_id_(104), 46 client_shader_id_(104),
45 client_texture_id_(106), 47 client_texture_id_(106),
(...skipping 30 matching lines...) Expand all
76 const char* extensions, 78 const char* extensions,
77 bool has_alpha, 79 bool has_alpha,
78 bool has_depth, 80 bool has_depth,
79 bool has_stencil, 81 bool has_stencil,
80 bool request_alpha, 82 bool request_alpha,
81 bool request_depth, 83 bool request_depth,
82 bool request_stencil, 84 bool request_stencil,
83 bool bind_generates_resource) { 85 bool bind_generates_resource) {
84 gl_.reset(new StrictMock<MockGLInterface>()); 86 gl_.reset(new StrictMock<MockGLInterface>());
85 ::gfx::GLInterface::SetGLInterface(gl_.get()); 87 ::gfx::GLInterface::SetGLInterface(gl_.get());
86 group_ = ContextGroup::Ref(new ContextGroup(NULL, bind_generates_resource)); 88 group_ = ContextGroup::Ref(new ContextGroup(NULL,
89 bind_generates_resource,
90 base::WeakPtr<ProgramCache>()));
87 91
88 InSequence sequence; 92 InSequence sequence;
89 93
90 TestHelper::SetupContextGroupInitExpectations(gl_.get(), 94 TestHelper::SetupContextGroupInitExpectations(gl_.get(),
91 DisallowedFeatures(), extensions); 95 DisallowedFeatures(), extensions);
92 96
93 EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL)); 97 EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL));
94 98
95 AddExpectationsForVertexAttribManager(); 99 AddExpectationsForVertexAttribManager();
96 100
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 num_vertices, buffer_id, GL_NO_ERROR); 1222 num_vertices, buffer_id, GL_NO_ERROR);
1219 } 1223 }
1220 1224
1221 void GLES2DecoderWithShaderTestBase::SetUp() { 1225 void GLES2DecoderWithShaderTestBase::SetUp() {
1222 GLES2DecoderTestBase::SetUp(); 1226 GLES2DecoderTestBase::SetUp();
1223 SetupDefaultProgram(); 1227 SetupDefaultProgram();
1224 } 1228 }
1225 1229
1226 } // namespace gles2 1230 } // namespace gles2
1227 } // namespace gpu 1231 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698