Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #if defined(ENABLE_GPU) | |
| 10 | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/memory/weak_ptr.h" | |
| 15 #include "content/common/content_export.h" | |
| 16 | |
| 17 class GpuCommandBufferStubBase; | |
| 18 | |
| 19 class CONTENT_EXPORT GpuMemoryManagerClient { | |
| 20 public: | |
| 21 virtual ~GpuMemoryManagerClient() {} | |
| 22 | |
| 23 virtual void AppendAllCommandBufferStubs( | |
| 24 std::vector<GpuCommandBufferStubBase*>& stubs) = 0; | |
| 25 }; | |
| 26 | |
| 27 class CONTENT_EXPORT GpuMemoryManager { | |
| 28 public: | |
| 29 class StubWithSurfaceComparator { | |
| 30 public: | |
| 31 bool operator()(GpuCommandBufferStubBase* lhs, | |
| 32 GpuCommandBufferStubBase* rhs); | |
| 33 }; | |
| 34 | |
| 35 public: | |
| 36 GpuMemoryManager(GpuMemoryManagerClient* client); | |
| 37 ~GpuMemoryManager(); | |
| 38 | |
| 39 void ScheduleManage(); | |
| 40 | |
| 41 private: | |
| 42 friend class GpuMemoryManagerTest; | |
| 43 void Manage(); | |
| 44 void SetMaxSurfacesWithFrontbufferSoftLimit(size_t limit); | |
|
nduca
2012/02/01 00:01:17
Construction time parameter? Default value it, per
| |
| 45 | |
| 46 private: | |
|
nduca
2012/02/01 00:01:17
redundant
| |
| 47 GpuMemoryManagerClient* client_; | |
| 48 bool manage_scheduled_; | |
| 49 size_t max_surfaces_with_frontbuffer_soft_limit_; | |
| 50 base::WeakPtrFactory<GpuMemoryManager> weak_factory_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); | |
| 53 }; | |
| 54 | |
| 55 #endif | |
| 56 | |
| 57 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | |
| OLD | NEW |