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

Side by Side Diff: components/exo/buffer.cc

Issue 2052003006: More YVU_420 buffers support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dnicoara's comment. Created 4 years, 6 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
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/buffer.h" 5 #include "components/exo/buffer.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 image_id_(0), 178 image_id_(0),
179 query_id_(0), 179 query_id_(0),
180 texture_id_(0), 180 texture_id_(0),
181 wait_for_release_pending_(false), 181 wait_for_release_pending_(false),
182 weak_ptr_factory_(this) { 182 weak_ptr_factory_(this) {
183 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 183 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
184 gfx::Size size = gpu_memory_buffer->GetSize(); 184 gfx::Size size = gpu_memory_buffer->GetSize();
185 image_id_ = 185 image_id_ =
186 gles2->CreateImageCHROMIUM(gpu_memory_buffer->AsClientBuffer(), 186 gles2->CreateImageCHROMIUM(gpu_memory_buffer->AsClientBuffer(),
187 size.width(), size.height(), internalformat_); 187 size.width(), size.height(), internalformat_);
188 DLOG_IF(WARNING, !image_id_) << "Failed to create GLImage";
189
188 gles2->GenQueriesEXT(1, &query_id_); 190 gles2->GenQueriesEXT(1, &query_id_);
189 texture_id_ = CreateGLTexture(gles2, texture_target_); 191 texture_id_ = CreateGLTexture(gles2, texture_target_);
190 } 192 }
191 193
192 Buffer::Texture::~Texture() { 194 Buffer::Texture::~Texture() {
193 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 195 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
194 gles2->DeleteTextures(1, &texture_id_); 196 gles2->DeleteTextures(1, &texture_id_);
195 if (query_id_) 197 if (query_id_)
196 gles2->DeleteQueriesEXT(1, &query_id_); 198 gles2->DeleteQueriesEXT(1, &query_id_);
197 if (image_id_) 199 if (image_id_)
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 497 }
496 498
497 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) { 499 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) {
498 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture"); 500 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture");
499 501
500 contents_texture_ = std::move(texture); 502 contents_texture_ = std::move(texture);
501 Release(); 503 Release();
502 } 504 }
503 505
504 } // namespace exo 506 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698