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

Side by Side Diff: content/browser/compositor/buffer_queue.cc

Issue 962723002: Change CHROMIUM_image declarations to support multi planar input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reveman@ comments and const-corrected function signatures. Created 5 years, 9 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 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
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();
181 unsigned int id = gl->CreateImageCHROMIUM( 182 unsigned int id = gl->CreateImageCHROMIUM(
182 buffer->AsClientBuffer(), size_.width(), size_.height(), internalformat_); 183 const_cast<const ClientBuffer* const>(&client_buffer), size_.width(),
184 size_.height(), internalformat_);
183 185
184 if (!id) { 186 if (!id) {
185 LOG(ERROR) << "Failed to allocate backing image surface"; 187 LOG(ERROR) << "Failed to allocate backing image surface";
186 gl->DeleteTextures(1, &texture); 188 gl->DeleteTextures(1, &texture);
187 return AllocatedSurface(); 189 return AllocatedSurface();
188 } 190 }
189 allocated_count_++; 191 allocated_count_++;
190 gl->BindTexture(GL_TEXTURE_2D, texture); 192 gl->BindTexture(GL_TEXTURE_2D, texture);
191 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id); 193 gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, id);
192 return AllocatedSurface(texture, id, gfx::Rect(size_)); 194 return AllocatedSurface(texture, id, gfx::Rect(size_));
193 } 195 }
194 196
195 } // namespace content 197 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698