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

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: mcasas@comments 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();
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698