diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-28 04:00:22 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-28 04:00:22 +0000 |
commit | 00b19257a178914bf74acc18d0c8dc41dddd2915 (patch) | |
tree | d82f383247f1c21841e3377ca4de8e3e096aa558 /gpu | |
parent | a7a6b495aee605f637f0e02dd8c5a89fefb27c72 (diff) | |
download | chromium_src-00b19257a178914bf74acc18d0c8dc41dddd2915.zip chromium_src-00b19257a178914bf74acc18d0c8dc41dddd2915.tar.gz chromium_src-00b19257a178914bf74acc18d0c8dc41dddd2915.tar.bz2 |
Add global tracking of GPU memory allocations. Have each ContextGroup push memory tracking information to the GpuMemoryManager. With this we can determine if we transiently oversubscribe.
BUG=135525
TEST=
Review URL: https://chromiumcodereview.appspot.com/10796096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
19 files changed, 180 insertions, 55 deletions
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc index 864027d..1fbf6b3 100644 --- a/gpu/command_buffer/service/buffer_manager.cc +++ b/gpu/command_buffer/service/buffer_manager.cc @@ -7,14 +7,18 @@ #include "base/logging.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" +#include "gpu/command_buffer/service/memory_tracking.h" namespace gpu { namespace gles2 { -BufferManager::BufferManager() - : allow_buffers_on_multiple_targets_(false), +BufferManager::BufferManager(MemoryTracker* memory_tracker) + : buffer_memory_tracker_(new MemoryTypeTracker( + memory_tracker, + "BufferManager", + "BufferMemory")), + allow_buffers_on_multiple_targets_(false), mem_represented_(0), - last_reported_mem_represented_(1), buffer_info_count_(0), have_context_(true) { UpdateMemRepresented(); @@ -33,11 +37,7 @@ void BufferManager::Destroy(bool have_context) { } void BufferManager::UpdateMemRepresented() { - if (mem_represented_ != last_reported_mem_represented_) { - last_reported_mem_represented_ = mem_represented_; - TRACE_COUNTER_ID1( - "BufferManager", "BufferMemory", this, mem_represented_); - } + buffer_memory_tracker_->UpdateMemRepresented(mem_represented_); } void BufferManager::CreateBufferInfo(GLuint client_id, GLuint service_id) { diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h index 49715cc..95ea5d3 100644 --- a/gpu/command_buffer/service/buffer_manager.h +++ b/gpu/command_buffer/service/buffer_manager.h @@ -17,6 +17,9 @@ namespace gpu { namespace gles2 { +class MemoryTracker; +class MemoryTypeTracker; + // This class keeps track of the buffers and their sizes so we can do // bounds checking. // @@ -155,7 +158,7 @@ class GPU_EXPORT BufferManager { RangeToMaxValueMap range_set_; }; - BufferManager(); + BufferManager(MemoryTracker* memory_tracker); ~BufferManager(); // Must call before destruction. @@ -193,6 +196,8 @@ class GPU_EXPORT BufferManager { void StartTracking(BufferInfo* info); void StopTracking(BufferInfo* info); + scoped_ptr<MemoryTypeTracker> buffer_memory_tracker_; + // Info for each buffer in the system. typedef base::hash_map<GLuint, BufferInfo::Ref> BufferInfoMap; BufferInfoMap buffer_infos_; @@ -201,7 +206,6 @@ class GPU_EXPORT BufferManager { bool allow_buffers_on_multiple_targets_; size_t mem_represented_; - size_t last_reported_mem_represented_; // Counts the number of BufferInfo allocated with 'this' as its manager. // Allows to check no BufferInfo will outlive this. diff --git a/gpu/command_buffer/service/buffer_manager_unittest.cc b/gpu/command_buffer/service/buffer_manager_unittest.cc index 7a84b05..dcb8038 100644 --- a/gpu/command_buffer/service/buffer_manager_unittest.cc +++ b/gpu/command_buffer/service/buffer_manager_unittest.cc @@ -11,7 +11,7 @@ namespace gles2 { class BufferManagerTest : public testing::Test { public: - BufferManagerTest() { + BufferManagerTest() : manager_(NULL) { } ~BufferManagerTest() { manager_.Destroy(false); diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc index a1ec47c..74110e6 100644 --- a/gpu/command_buffer/service/context_group.cc +++ b/gpu/command_buffer/service/context_group.cc @@ -15,6 +15,7 @@ #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/mailbox_manager.h" +#include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/program_manager.h" #include "gpu/command_buffer/service/renderbuffer_manager.h" #include "gpu/command_buffer/service/shader_manager.h" @@ -27,8 +28,10 @@ namespace gles2 { ContextGroup::ContextGroup( MailboxManager* mailbox_manager, + MemoryTracker* memory_tracker, bool bind_generates_resource) : mailbox_manager_(mailbox_manager ? mailbox_manager : new MailboxManager), + memory_tracker_(memory_tracker), num_contexts_(0), enforce_gl_minimums_(CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnforceGLMinimums)), @@ -90,10 +93,11 @@ bool ContextGroup::Initialize(const DisallowedFeatures& disallowed_features, glGetIntegerv(GL_MAX_SAMPLES, &max_samples); } - buffer_manager_.reset(new BufferManager()); + buffer_manager_.reset(new BufferManager(memory_tracker_)); framebuffer_manager_.reset(new FramebufferManager()); - renderbuffer_manager_.reset(new RenderbufferManager( - max_renderbuffer_size, max_samples)); + renderbuffer_manager_.reset(new RenderbufferManager(memory_tracker_, + max_renderbuffer_size, + max_samples)); shader_manager_.reset(new ShaderManager()); program_manager_.reset(new ProgramManager(program_cache_)); @@ -150,7 +154,8 @@ bool ContextGroup::Initialize(const DisallowedFeatures& disallowed_features, } } #endif - texture_manager_.reset(new TextureManager(feature_info_.get(), + texture_manager_.reset(new TextureManager(memory_tracker_, + feature_info_.get(), max_texture_size, max_cube_map_texture_size)); @@ -241,6 +246,10 @@ void ContextGroup::Destroy(bool have_context) { shader_manager_->Destroy(have_context); shader_manager_.reset(); } + + if (memory_tracker_.get()) { + memory_tracker_.release(); + } } IdAllocatorInterface* ContextGroup::GetIdAllocator(unsigned namespace_id) { diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h index 55e02e6..671d0ff 100644 --- a/gpu/command_buffer/service/context_group.h +++ b/gpu/command_buffer/service/context_group.h @@ -32,6 +32,7 @@ class RenderbufferManager; class ProgramManager; class ShaderManager; class TextureManager; +class MemoryTracker; struct DisallowedFeatures; // A Context Group helps manage multiple GLES2Decoders that share @@ -42,6 +43,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { ContextGroup( MailboxManager* mailbox_manager, + MemoryTracker* memory_tracker, bool bind_generates_resource); // This should only be called by GLES2Decoder. This must be paired with a @@ -57,6 +59,10 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { return mailbox_manager_.get(); } + MemoryTracker* memory_tracker() const { + return memory_tracker_.get(); + } + bool bind_generates_resource() { return bind_generates_resource_; } @@ -143,6 +149,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); scoped_refptr<MailboxManager> mailbox_manager_; + scoped_refptr<MemoryTracker> memory_tracker_; scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; // Whether or not this context is initialized. diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc index e0eb64a..6f6c919 100644 --- a/gpu/command_buffer/service/context_group_unittest.cc +++ b/gpu/command_buffer/service/context_group_unittest.cc @@ -36,7 +36,7 @@ class ContextGroupTest : public testing::Test { virtual void SetUp() { gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); ::gfx::GLInterface::SetGLInterface(gl_.get()); - group_ = ContextGroup::Ref(new ContextGroup(NULL, true)); + group_ = ContextGroup::Ref(new ContextGroup(NULL, NULL, true)); } virtual void TearDown() { diff --git a/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/gpu/command_buffer/service/framebuffer_manager_unittest.cc index de34126..7727ebe 100644 --- a/gpu/command_buffer/service/framebuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/framebuffer_manager_unittest.cc @@ -19,8 +19,9 @@ class FramebufferManagerTest : public testing::Test { public: FramebufferManagerTest() - : texture_manager_(new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), - renderbuffer_manager_(kMaxRenderbufferSize, kMaxSamples) { + : texture_manager_( + NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), + renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) { } ~FramebufferManagerTest() { @@ -112,8 +113,9 @@ class FramebufferInfoTest : public testing::Test { FramebufferInfoTest() : manager_(), - texture_manager_(new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), - renderbuffer_manager_(kMaxRenderbufferSize, kMaxSamples) { + texture_manager_( + NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), + renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) { } ~FramebufferInfoTest() { manager_.Destroy(false); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index b865db4..04b94baf 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -84,7 +84,9 @@ void GLES2DecoderTestBase::InitDecoder( bool bind_generates_resource) { gl_.reset(new StrictMock<MockGLInterface>()); ::gfx::GLInterface::SetGLInterface(gl_.get()); - group_ = ContextGroup::Ref(new ContextGroup(NULL, bind_generates_resource)); + group_ = ContextGroup::Ref(new ContextGroup(NULL, + NULL, + bind_generates_resource)); InSequence sequence; diff --git a/gpu/command_buffer/service/memory_tracking.h b/gpu/command_buffer/service/memory_tracking.h new file mode 100644 index 0000000..36653272 --- /dev/null +++ b/gpu/command_buffer/service/memory_tracking.h @@ -0,0 +1,77 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ +#define GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ + +#include <string> +#include "base/basictypes.h" +#include "base/debug/trace_event.h" + +namespace gpu { +namespace gles2 { + +// A MemoryTracker is used to propagate per-ContextGroup memory usage +// statistics to the global GpuMemoryManager. +class MemoryTracker : public base::RefCounted<MemoryTracker> { + public: + virtual void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) = 0; + + protected: + friend class base::RefCounted<MemoryTracker>; + MemoryTracker() {} + virtual ~MemoryTracker() {}; + + private: + DISALLOW_COPY_AND_ASSIGN(MemoryTracker); +}; + +// A MemoryTypeTracker tracks the use of a particular type of memory (buffer, +// texture, or renderbuffer) and forward the result to a specified +// MemoryTracker. +class MemoryTypeTracker { + public: + MemoryTypeTracker( + MemoryTracker* memory_tracker, + const char* trace_category, + const char* trace_name) + : memory_tracker_(memory_tracker), + trace_category_(trace_category), + trace_name_(trace_name), + has_updated_mem_represented_(false), + last_updated_mem_represented_(0) { + } + + void UpdateMemRepresented(size_t mem_represented) { + if (!has_updated_mem_represented_ && + mem_represented == last_updated_mem_represented_) { + return; + } + if (memory_tracker_) { + memory_tracker_->TrackMemoryAllocatedChange( + last_updated_mem_represented_, + mem_represented); + } + has_updated_mem_represented_ = true; + last_updated_mem_represented_ = mem_represented; + TRACE_COUNTER_ID1(trace_category_, + trace_name_, + memory_tracker_, + last_updated_mem_represented_); + } + + private: + MemoryTracker* memory_tracker_; + const char* trace_category_; + const char* trace_name_; + bool has_updated_mem_represented_; + size_t last_updated_mem_represented_; + + DISALLOW_COPY_AND_ASSIGN(MemoryTypeTracker); +}; + +} // namespace gles2 +} // namespace gpu + +#endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ diff --git a/gpu/command_buffer/service/renderbuffer_manager.cc b/gpu/command_buffer/service/renderbuffer_manager.cc index 8a37ec6..2f1d3c3 100644 --- a/gpu/command_buffer/service/renderbuffer_manager.cc +++ b/gpu/command_buffer/service/renderbuffer_manager.cc @@ -7,13 +7,20 @@ #include "base/debug/trace_event.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" +#include "gpu/command_buffer/service/memory_tracking.h" namespace gpu { namespace gles2 { RenderbufferManager::RenderbufferManager( - GLint max_renderbuffer_size, GLint max_samples) - : max_renderbuffer_size_(max_renderbuffer_size), + MemoryTracker* memory_tracker, + GLint max_renderbuffer_size, + GLint max_samples) + : renderbuffer_memory_tracker_(new MemoryTypeTracker( + memory_tracker, + "RenderbufferManager", + "RenderbufferMemory")), + max_renderbuffer_size_(max_renderbuffer_size), max_samples_(max_samples), num_uncleared_renderbuffers_(0), mem_represented_(0), @@ -48,8 +55,7 @@ RenderbufferManager::RenderbufferInfo::~RenderbufferInfo() { } void RenderbufferManager::UpdateMemRepresented() { - TRACE_COUNTER_ID1( - "RenderbufferManager", "RenderbufferMemory", this, mem_represented_); + renderbuffer_memory_tracker_->UpdateMemRepresented(mem_represented_); } void RenderbufferManager::Destroy(bool have_context) { diff --git a/gpu/command_buffer/service/renderbuffer_manager.h b/gpu/command_buffer/service/renderbuffer_manager.h index 6a99e2f..c562185 100644 --- a/gpu/command_buffer/service/renderbuffer_manager.h +++ b/gpu/command_buffer/service/renderbuffer_manager.h @@ -15,6 +15,9 @@ namespace gpu { namespace gles2 { +class MemoryTracker; +class MemoryTypeTracker; + // This class keeps track of the renderbuffers and whether or not they have // been cleared. class GPU_EXPORT RenderbufferManager { @@ -124,7 +127,9 @@ class GPU_EXPORT RenderbufferManager { GLsizei height_; }; - RenderbufferManager(GLint max_renderbuffer_size, GLint max_samples); + RenderbufferManager(MemoryTracker* memory_tracker, + GLint max_renderbuffer_size, + GLint max_samples); ~RenderbufferManager(); GLint max_renderbuffer_size() const { @@ -170,6 +175,8 @@ class GPU_EXPORT RenderbufferManager { void StartTracking(RenderbufferInfo* renderbuffer); void StopTracking(RenderbufferInfo* renderbuffer); + scoped_ptr<MemoryTypeTracker> renderbuffer_memory_tracker_; + GLint max_renderbuffer_size_; GLint max_samples_; diff --git a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc index a5122e1..8e13ac9 100644 --- a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc @@ -16,7 +16,7 @@ class RenderbufferManagerTest : public testing::Test { static const GLint kMaxSamples = 4; RenderbufferManagerTest() - : manager_(kMaxSize, kMaxSamples) { + : manager_(NULL, kMaxSize, kMaxSamples) { } ~RenderbufferManagerTest() { manager_.Destroy(false); diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index fbbdec6..5c8c189 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc @@ -4,11 +4,11 @@ #include "gpu/command_buffer/service/texture_manager.h" #include "base/bits.h" -#include "base/debug/trace_event.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/mailbox_manager.h" +#include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/texture_definition.h" namespace gpu { @@ -589,10 +589,15 @@ bool TextureManager::TextureInfo::ClearLevel( } TextureManager::TextureManager( + MemoryTracker* memory_tracker, FeatureInfo* feature_info, GLint max_texture_size, GLint max_cube_map_texture_size) - : feature_info_(feature_info), + : texture_memory_tracker_(new MemoryTypeTracker( + memory_tracker, + "TextureManager", + "TextureMemory")), + feature_info_(feature_info), max_texture_size_(max_texture_size), max_cube_map_texture_size_(max_cube_map_texture_size), max_levels_(ComputeMipMapCount(max_texture_size, @@ -606,7 +611,6 @@ TextureManager::TextureManager( num_uncleared_mips_(0), texture_info_count_(0), mem_represented_(0), - last_reported_mem_represented_(1), have_context_(true) { for (int ii = 0; ii < kNumDefaultTextures; ++ii) { black_texture_ids_[ii] = 0; @@ -614,11 +618,7 @@ TextureManager::TextureManager( } void TextureManager::UpdateMemRepresented() { - if (mem_represented_ != last_reported_mem_represented_) { - last_reported_mem_represented_ = mem_represented_; - TRACE_COUNTER_ID1( - "TextureManager", "TextureMemory", this, mem_represented_); - } + texture_memory_tracker_->UpdateMemRepresented(mem_represented_); } bool TextureManager::Initialize() { diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h index a157146..33c378d 100644 --- a/gpu/command_buffer/service/texture_manager.h +++ b/gpu/command_buffer/service/texture_manager.h @@ -20,6 +20,8 @@ namespace gles2 { class GLES2Decoder; class Display; class TextureDefinition; +class MemoryTracker; +class MemoryTypeTracker; // This class keeps track of the textures and their sizes so we can do NPOT and // texture complete checking. @@ -351,7 +353,8 @@ class GPU_EXPORT TextureManager { DISALLOW_COPY_AND_ASSIGN(TextureInfo); }; - TextureManager(FeatureInfo* feature_info, + TextureManager(MemoryTracker* memory_tracker, + FeatureInfo* feature_info, GLsizei max_texture_size, GLsizei max_cube_map_texture_size); ~TextureManager(); @@ -524,6 +527,8 @@ class GPU_EXPORT TextureManager { void StartTracking(TextureInfo* info); void StopTracking(TextureInfo* info); + scoped_ptr<MemoryTypeTracker> texture_memory_tracker_; + FeatureInfo::Ref feature_info_; // Info for each texture in the system. @@ -544,7 +549,6 @@ class GPU_EXPORT TextureManager { unsigned int texture_info_count_; uint32 mem_represented_; - uint32 last_reported_mem_represented_; bool have_context_; diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc index 5079e77..5207450 100644 --- a/gpu/command_buffer/service/texture_manager_unittest.cc +++ b/gpu/command_buffer/service/texture_manager_unittest.cc @@ -29,7 +29,8 @@ class TextureManagerTest : public testing::Test { TextureManagerTest() : feature_info_(new FeatureInfo()), - manager_(feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize) { + manager_( + NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize) { } ~TextureManagerTest() { @@ -127,7 +128,7 @@ TEST_F(TextureManagerTest, TextureUsageExt) { TestHelper::SetupTextureManagerInitExpectations(gl_.get(), "GL_ANGLE_texture_usage"); TextureManager manager( - feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.Initialize(); const GLuint kClient1Id = 1; const GLuint kService1Id = 11; @@ -148,7 +149,7 @@ TEST_F(TextureManagerTest, Destroy) { const GLuint kService1Id = 11; TestHelper::SetupTextureManagerInitExpectations(gl_.get(), ""); TextureManager manager( - feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.Initialize(); // Check we can create texture. manager.CreateTextureInfo(kClient1Id, kService1Id); @@ -170,7 +171,7 @@ TEST_F(TextureManagerTest, DestroyUnowned) { const GLuint kService1Id = 11; TestHelper::SetupTextureManagerInitExpectations(gl_.get(), ""); TextureManager manager( - feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.Initialize(); // Check we can create texture. TextureManager::TextureInfo* created_info = @@ -278,7 +279,7 @@ TEST_F(TextureManagerTest, ValidForTargetNPOT) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); // Check NPOT width on level 0 EXPECT_TRUE(manager.ValidForTarget(GL_TEXTURE_2D, 0, 5, 2, 1)); // Check NPOT height on level 0 @@ -301,7 +302,8 @@ class TextureInfoTest : public testing::Test { TextureInfoTest() : feature_info_(new FeatureInfo()), - manager_(feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize) { + manager_( + NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize) { } ~TextureInfoTest() { info_ = NULL; @@ -478,7 +480,7 @@ TEST_F(TextureInfoTest, NPOT2DNPOTOK) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info_ != NULL); @@ -673,7 +675,7 @@ TEST_F(TextureInfoTest, FloatNotLinear) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); @@ -695,7 +697,7 @@ TEST_F(TextureInfoTest, FloatLinear) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); @@ -713,7 +715,7 @@ TEST_F(TextureInfoTest, HalfFloatNotLinear) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); @@ -735,7 +737,7 @@ TEST_F(TextureInfoTest, HalfFloatLinear) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); @@ -753,7 +755,7 @@ TEST_F(TextureInfoTest, EGLImageExternal) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); @@ -769,7 +771,7 @@ TEST_F(TextureInfoTest, DepthTexture) { FeatureInfo::Ref feature_info(new FeatureInfo()); feature_info->Initialize(NULL); TextureManager manager( - feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); + NULL, feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); manager.CreateTextureInfo(kClient1Id, kService1Id); TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); ASSERT_TRUE(info != NULL); diff --git a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc index f0496a1..cb34022 100644 --- a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc +++ b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc @@ -112,7 +112,7 @@ TEST_F(VertexAttribManagerTest, Enable) { } TEST_F(VertexAttribManagerTest, SetAttribInfo) { - BufferManager buffer_manager; + BufferManager buffer_manager(NULL); buffer_manager.CreateBufferInfo(1, 2); BufferManager::BufferInfo* buffer = buffer_manager.GetBufferInfo(1); ASSERT_TRUE(buffer != NULL); @@ -148,7 +148,7 @@ TEST_F(VertexAttribManagerTest, HaveFixedAttribs) { } TEST_F(VertexAttribManagerTest, CanAccess) { - BufferManager buffer_manager; + BufferManager buffer_manager(NULL); buffer_manager.CreateBufferInfo(1, 2); BufferManager::BufferInfo* buffer = buffer_manager.GetBufferInfo(1); ASSERT_TRUE(buffer != NULL); @@ -190,7 +190,7 @@ TEST_F(VertexAttribManagerTest, CanAccess) { } TEST_F(VertexAttribManagerTest, Unbind) { - BufferManager buffer_manager; + BufferManager buffer_manager(NULL); buffer_manager.CreateBufferInfo(1, 2); buffer_manager.CreateBufferInfo(3, 4); BufferManager::BufferInfo* buffer1 = buffer_manager.GetBufferInfo(1); diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc index 4fad23e..45589b6 100644 --- a/gpu/command_buffer/tests/gl_manager.cc +++ b/gpu/command_buffer/tests/gl_manager.cc @@ -98,6 +98,7 @@ void GLManager::Setup( if (!context_group) { context_group = new gles2::ContextGroup(mailbox_manager_.get(), + NULL, kBindGeneratesResource); } diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc index 1421aae..42335c8 100644 --- a/gpu/demos/framework/window.cc +++ b/gpu/demos/framework/window.cc @@ -79,7 +79,9 @@ bool Window::CreateRenderContext(gfx::AcceleratedWidget hwnd) { return false; } - gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(NULL, true)); + gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(NULL, + NULL, + true)); decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); if (!decoder_.get()) diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index 0e92d09..b00770e 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc @@ -96,7 +96,9 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config, if (!command_buffer->Initialize()) return NULL; - gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(NULL, true)); + gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(NULL, + NULL, + true)); decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); if (!decoder_.get()) |