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

Side by Side Diff: content/common/gpu/gpu_memory_manager_unittest.cc

Issue 1256613002: Add tracing for GL texture objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_process_id
Patch Set: Key texture manager memory dump provider registration off of memory_tracker_ Created 5 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
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 "content/common/gpu/gpu_memory_manager.h" 5 #include "content/common/gpu/gpu_memory_manager.h"
6 6
7 #include "content/common/gpu/gpu_memory_manager_client.h" 7 #include "content/common/gpu/gpu_memory_manager_client.h"
8 #include "content/common/gpu/gpu_memory_tracking.h" 8 #include "content/common/gpu/gpu_memory_tracking.h"
9 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 9 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gfx/geometry/size_conversions.h" 11 #include "ui/gfx/geometry/size_conversions.h"
12 12
13 using gpu::MemoryAllocation; 13 using gpu::MemoryAllocation;
14 14
15 class FakeMemoryTracker : public gpu::gles2::MemoryTracker { 15 class FakeMemoryTracker : public gpu::gles2::MemoryTracker {
16 public: 16 public:
17 void TrackMemoryAllocatedChange( 17 void TrackMemoryAllocatedChange(
18 size_t /* old_size */, 18 size_t /* old_size */,
19 size_t /* new_size */, 19 size_t /* new_size */,
20 gpu::gles2::MemoryTracker::Pool /* pool */) override {} 20 gpu::gles2::MemoryTracker::Pool /* pool */) override {}
21 bool EnsureGPUMemoryAvailable(size_t /* size_needed */) override { 21 bool EnsureGPUMemoryAvailable(size_t /* size_needed */) override {
22 return true; 22 return true;
23 } 23 }
24 uint64_t ClientTracingId() const override { return 0; }
25 int ClientId() const override { return 0; }
26
24 private: 27 private:
25 ~FakeMemoryTracker() override {} 28 ~FakeMemoryTracker() override {}
26 }; 29 };
27 30
28 namespace content { 31 namespace content {
29 32
30 // This class is used to collect all stub assignments during a 33 // This class is used to collect all stub assignments during a
31 // Manage() call. 34 // Manage() call.
32 class ClientAssignmentCollector { 35 class ClientAssignmentCollector {
33 public: 36 public:
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 stub_ignore_c.SetVisible(true); 397 stub_ignore_c.SetVisible(true);
395 stub_ignore_c.SetVisible(false); 398 stub_ignore_c.SetVisible(false);
396 Manage(); 399 Manage();
397 EXPECT_TRUE(IsAllocationHibernatedForSurfaceYes(stub1.allocation_)); 400 EXPECT_TRUE(IsAllocationHibernatedForSurfaceYes(stub1.allocation_));
398 EXPECT_TRUE(IsAllocationHibernatedForSurfaceYes(stub2.allocation_)); 401 EXPECT_TRUE(IsAllocationHibernatedForSurfaceYes(stub2.allocation_));
399 EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub3.allocation_)); 402 EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub3.allocation_));
400 EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub4.allocation_)); 403 EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub4.allocation_));
401 } 404 }
402 405
403 } // namespace content 406 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/host_shared_bitmap_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698