OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "content/common/gpu/stream_texture_manager_android.h" | 37 #include "content/common/gpu/stream_texture_manager_android.h" |
38 #endif | 38 #endif |
39 | 39 |
40 namespace content { | 40 namespace content { |
41 namespace { | 41 namespace { |
42 | 42 |
43 // The GpuCommandBufferMemoryTracker class provides a bridge between the | 43 // The GpuCommandBufferMemoryTracker class provides a bridge between the |
44 // ContextGroup's memory type managers and the GpuMemoryManager class. | 44 // ContextGroup's memory type managers and the GpuMemoryManager class. |
45 class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker { | 45 class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker { |
46 public: | 46 public: |
47 GpuCommandBufferMemoryTracker(GpuChannel* channel) : | 47 explicit GpuCommandBufferMemoryTracker(GpuChannel* channel) : |
48 tracking_group_(channel->gpu_channel_manager()->gpu_memory_manager()-> | 48 tracking_group_(channel->gpu_channel_manager()->gpu_memory_manager()-> |
49 CreateTrackingGroup(channel->renderer_pid(), this)) { | 49 CreateTrackingGroup(channel->renderer_pid(), this)) { |
50 } | 50 } |
51 | 51 |
52 void TrackMemoryAllocatedChange(size_t old_size, | 52 void TrackMemoryAllocatedChange(size_t old_size, |
53 size_t new_size, | 53 size_t new_size, |
54 gpu::gles2::MemoryTracker::Pool pool) { | 54 gpu::gles2::MemoryTracker::Pool pool) { |
55 tracking_group_->TrackMemoryAllocatedChange( | 55 tracking_group_->TrackMemoryAllocatedChange( |
56 old_size, new_size, pool); | 56 old_size, new_size, pool); |
57 } | 57 } |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 route_id_, allocation.renderer_allocation)); | 865 route_id_, allocation.renderer_allocation)); |
866 // This can be called outside of OnMessageReceived, so the context needs to be | 866 // This can be called outside of OnMessageReceived, so the context needs to be |
867 // made current before calling methods on the surface. | 867 // made current before calling methods on the surface. |
868 if (!surface_ || !MakeCurrent()) | 868 if (!surface_ || !MakeCurrent()) |
869 return; | 869 return; |
870 surface_->SetFrontbufferAllocation( | 870 surface_->SetFrontbufferAllocation( |
871 allocation.browser_allocation.suggest_have_frontbuffer); | 871 allocation.browser_allocation.suggest_have_frontbuffer); |
872 } | 872 } |
873 | 873 |
874 } // namespace content | 874 } // namespace content |
OLD | NEW |