OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/compositor/buffer_queue.h" | 5 #include "content/browser/compositor/buffer_queue.h" |
6 | 6 |
7 #include "content/browser/compositor/image_transport_factory.h" | 7 #include "content/browser/compositor/image_transport_factory.h" |
8 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 8 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
9 #include "content/common/gpu/client/context_provider_command_buffer.h" | 9 #include "content/common/gpu/client/context_provider_command_buffer.h" |
10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 gpu_memory_buffer_manager_->AllocateGpuMemoryBufferForScanout( | 171 gpu_memory_buffer_manager_->AllocateGpuMemoryBufferForScanout( |
172 size_, gpu::ImageFactory::ImageFormatToGpuMemoryBufferFormat( | 172 size_, gpu::ImageFactory::ImageFormatToGpuMemoryBufferFormat( |
173 internalformat_), | 173 internalformat_), |
174 surface_id_)); | 174 surface_id_)); |
175 if (!buffer) { | 175 if (!buffer) { |
176 gl->DeleteTextures(1, &texture); | 176 gl->DeleteTextures(1, &texture); |
177 DLOG(ERROR) << "Failed to allocate GPU memory buffer"; | 177 DLOG(ERROR) << "Failed to allocate GPU memory buffer"; |
178 return AllocatedSurface(); | 178 return AllocatedSurface(); |
179 } | 179 } |
180 | 180 |
181 const ClientBuffer& client_buffer = buffer->AsClientBuffer(); | |
reveman
2015/03/02 20:09:55
&buffer->AsClientBuffer() below instead of this te
emircan
2015/03/03 02:02:18
Same issue as the earlier.
| |
181 unsigned int id = gl->CreateImageCHROMIUM( | 182 unsigned int id = gl->CreateImageCHROMIUM( |
182 buffer->AsClientBuffer(), size_.width(), size_.height(), internalformat_); | 183 &client_buffer, size_.width(), size_.height(), internalformat_); |
183 | 184 |
184 if (!id) { | 185 if (!id) { |
185 LOG(ERROR) << "Failed to allocate backing image surface"; | 186 LOG(ERROR) << "Failed to allocate backing image surface"; |
186 gl->DeleteTextures(1, &texture); | 187 gl->DeleteTextures(1, &texture); |
187 return AllocatedSurface(); | 188 return AllocatedSurface(); |
188 } | 189 } |
189 allocated_count_++; | 190 allocated_count_++; |
190 gl->BindTexture(GL_TEXTURE_2D, texture); | 191 gl->BindTexture(GL_TEXTURE_2D, texture); |
191 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id); | 192 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id); |
192 return AllocatedSurface(texture, id, gfx::Rect(size_)); | 193 return AllocatedSurface(texture, id, gfx::Rect(size_)); |
193 } | 194 } |
194 | 195 |
195 } // namespace content | 196 } // namespace content |
OLD | NEW |