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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 : surface_id(surface_id), | 93 : surface_id(surface_id), |
94 visible(visible), | 94 visible(visible), |
95 last_used_time(last_used_time) { | 95 last_used_time(last_used_time) { |
96 } | 96 } |
97 | 97 |
98 GpuCommandBufferStub::GpuCommandBufferStub( | 98 GpuCommandBufferStub::GpuCommandBufferStub( |
99 GpuChannel* channel, | 99 GpuChannel* channel, |
100 GpuCommandBufferStub* share_group, | 100 GpuCommandBufferStub* share_group, |
101 const gfx::GLSurfaceHandle& handle, | 101 const gfx::GLSurfaceHandle& handle, |
102 gpu::gles2::MailboxManager* mailbox_manager, | 102 gpu::gles2::MailboxManager* mailbox_manager, |
| 103 gpu::gles2::ImageManager* image_manager, |
103 const gfx::Size& size, | 104 const gfx::Size& size, |
104 const gpu::gles2::DisallowedFeatures& disallowed_features, | 105 const gpu::gles2::DisallowedFeatures& disallowed_features, |
105 const std::string& allowed_extensions, | 106 const std::string& allowed_extensions, |
106 const std::vector<int32>& attribs, | 107 const std::vector<int32>& attribs, |
107 gfx::GpuPreference gpu_preference, | 108 gfx::GpuPreference gpu_preference, |
108 int32 route_id, | 109 int32 route_id, |
109 int32 surface_id, | 110 int32 surface_id, |
110 GpuWatchdog* watchdog, | 111 GpuWatchdog* watchdog, |
111 bool software, | 112 bool software, |
112 const GURL& active_url) | 113 const GURL& active_url) |
(...skipping 14 matching lines...) Expand all Loading... |
127 sync_point_wait_count_(0), | 128 sync_point_wait_count_(0), |
128 delayed_work_scheduled_(false), | 129 delayed_work_scheduled_(false), |
129 active_url_(active_url) { | 130 active_url_(active_url) { |
130 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); | 131 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); |
131 FastSetActiveURL(active_url_, active_url_hash_); | 132 FastSetActiveURL(active_url_, active_url_hash_); |
132 if (share_group) { | 133 if (share_group) { |
133 context_group_ = share_group->context_group_; | 134 context_group_ = share_group->context_group_; |
134 } else { | 135 } else { |
135 context_group_ = new gpu::gles2::ContextGroup( | 136 context_group_ = new gpu::gles2::ContextGroup( |
136 mailbox_manager, | 137 mailbox_manager, |
| 138 image_manager, |
137 new GpuCommandBufferMemoryTracker(channel), | 139 new GpuCommandBufferMemoryTracker(channel), |
138 true); | 140 true); |
139 } | 141 } |
140 if (surface_id != 0) | 142 if (surface_id != 0) |
141 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( | 143 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( |
142 surface_id, true, base::TimeTicks::Now())); | 144 surface_id, true, base::TimeTicks::Now())); |
143 if (handle_.sync_point) | 145 if (handle_.sync_point) |
144 OnWaitSyncPoint(handle_.sync_point); | 146 OnWaitSyncPoint(handle_.sync_point); |
145 } | 147 } |
146 | 148 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 const GpuMemoryAllocation& allocation) { | 847 const GpuMemoryAllocation& allocation) { |
846 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); | 848 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
847 // This can be called outside of OnMessageReceived, so the context needs to be | 849 // This can be called outside of OnMessageReceived, so the context needs to be |
848 // made current before calling methods on the surface. | 850 // made current before calling methods on the surface. |
849 if (!surface_ || !MakeCurrent()) | 851 if (!surface_ || !MakeCurrent()) |
850 return; | 852 return; |
851 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); | 853 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); |
852 } | 854 } |
853 | 855 |
854 #endif // defined(ENABLE_GPU) | 856 #endif // defined(ENABLE_GPU) |
OLD | NEW |