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

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

Issue 10796096: Add tracing of all memory allocated in all contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More trybot constructor fixes Created 8 years, 4 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 | Annotate | Revision Log
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/framebuffer_manager.h" 5 #include "gpu/command_buffer/service/framebuffer_manager.h"
6 #include "gpu/command_buffer/service/feature_info.h" 6 #include "gpu/command_buffer/service/feature_info.h"
7 7
8 #include "gpu/command_buffer/common/gl_mock.h" 8 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace gpu { 11 namespace gpu {
12 namespace gles2 { 12 namespace gles2 {
13 13
14 class FramebufferManagerTest : public testing::Test { 14 class FramebufferManagerTest : public testing::Test {
15 static const GLint kMaxTextureSize = 64; 15 static const GLint kMaxTextureSize = 64;
16 static const GLint kMaxCubemapSize = 64; 16 static const GLint kMaxCubemapSize = 64;
17 static const GLint kMaxRenderbufferSize = 64; 17 static const GLint kMaxRenderbufferSize = 64;
18 static const GLint kMaxSamples = 4; 18 static const GLint kMaxSamples = 4;
19 19
20 public: 20 public:
21 FramebufferManagerTest() 21 FramebufferManagerTest()
22 : texture_manager_(new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), 22 : texture_manager_(
23 renderbuffer_manager_(kMaxRenderbufferSize, kMaxSamples) { 23 NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize),
24 renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) {
24 25
25 } 26 }
26 ~FramebufferManagerTest() { 27 ~FramebufferManagerTest() {
27 manager_.Destroy(false); 28 manager_.Destroy(false);
28 texture_manager_.Destroy(false); 29 texture_manager_.Destroy(false);
29 renderbuffer_manager_.Destroy(false); 30 renderbuffer_manager_.Destroy(false);
30 } 31 }
31 32
32 protected: 33 protected:
33 virtual void SetUp() { 34 virtual void SetUp() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 static const GLuint kClient1Id = 1; 106 static const GLuint kClient1Id = 1;
106 static const GLuint kService1Id = 11; 107 static const GLuint kService1Id = 11;
107 108
108 static const GLint kMaxTextureSize = 64; 109 static const GLint kMaxTextureSize = 64;
109 static const GLint kMaxCubemapSize = 64; 110 static const GLint kMaxCubemapSize = 64;
110 static const GLint kMaxRenderbufferSize = 64; 111 static const GLint kMaxRenderbufferSize = 64;
111 static const GLint kMaxSamples = 4; 112 static const GLint kMaxSamples = 4;
112 113
113 FramebufferInfoTest() 114 FramebufferInfoTest()
114 : manager_(), 115 : manager_(),
115 texture_manager_(new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), 116 texture_manager_(
116 renderbuffer_manager_(kMaxRenderbufferSize, kMaxSamples) { 117 NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize),
118 renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) {
117 } 119 }
118 ~FramebufferInfoTest() { 120 ~FramebufferInfoTest() {
119 manager_.Destroy(false); 121 manager_.Destroy(false);
120 texture_manager_.Destroy(false); 122 texture_manager_.Destroy(false);
121 renderbuffer_manager_.Destroy(false); 123 renderbuffer_manager_.Destroy(false);
122 } 124 }
123 125
124 protected: 126 protected:
125 virtual void SetUp() { 127 virtual void SetUp() {
126 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); 128 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 manager_.MarkAsComplete(info_); 627 manager_.MarkAsComplete(info_);
626 EXPECT_TRUE(manager_.IsComplete(info_)); 628 EXPECT_TRUE(manager_.IsComplete(info_));
627 info_->UnbindTexture(kTarget1, tex_info2); 629 info_->UnbindTexture(kTarget1, tex_info2);
628 EXPECT_FALSE(manager_.IsComplete(info_)); 630 EXPECT_FALSE(manager_.IsComplete(info_));
629 } 631 }
630 632
631 } // namespace gles2 633 } // namespace gles2
632 } // namespace gpu 634 } // namespace gpu
633 635
634 636
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698