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

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

Issue 2639973002: Add target argument to Copy{Sub}TextureCHROMIUM entry point (Closed)
Patch Set: use dest_target instead of target Created 3 years, 11 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 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 gpu::SyncToken Buffer::Texture::CopyTexImage(Texture* destination, 280 gpu::SyncToken Buffer::Texture::CopyTexImage(Texture* destination,
281 const base::Closure& callback) { 281 const base::Closure& callback) {
282 gpu::SyncToken sync_token; 282 gpu::SyncToken sync_token;
283 if (context_provider_) { 283 if (context_provider_) {
284 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 284 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
285 gles2->ActiveTexture(GL_TEXTURE0); 285 gles2->ActiveTexture(GL_TEXTURE0);
286 gles2->BindTexture(texture_target_, texture_id_); 286 gles2->BindTexture(texture_target_, texture_id_);
287 DCHECK_NE(image_id_, 0u); 287 DCHECK_NE(image_id_, 0u);
288 gles2->BindTexImage2DCHROMIUM(texture_target_, image_id_); 288 gles2->BindTexImage2DCHROMIUM(texture_target_, image_id_);
289 gles2->CopyTextureCHROMIUM(texture_id_, 0, destination->texture_id_, 0, 289 gles2->CopyTextureCHROMIUM(texture_id_, 0, destination->texture_target_,
290 internalformat_, GL_UNSIGNED_BYTE, false, false, 290 destination->texture_id_, 0, internalformat_,
291 false); 291 GL_UNSIGNED_BYTE, false, false, false);
292 DCHECK_NE(query_id_, 0u); 292 DCHECK_NE(query_id_, 0u);
293 gles2->BeginQueryEXT(query_type_, query_id_); 293 gles2->BeginQueryEXT(query_type_, query_id_);
294 gles2->ReleaseTexImage2DCHROMIUM(texture_target_, image_id_); 294 gles2->ReleaseTexImage2DCHROMIUM(texture_target_, image_id_);
295 gles2->EndQueryEXT(query_type_); 295 gles2->EndQueryEXT(query_type_);
296 // Run callback when query result is available and ReleaseTexImage has been 296 // Run callback when query result is available and ReleaseTexImage has been
297 // handled. 297 // handled.
298 ReleaseWhenQueryResultIsAvailable(callback); 298 ReleaseWhenQueryResultIsAvailable(callback);
299 // Create and return a sync token that can be used to ensure that the 299 // Create and return a sync token that can be used to ensure that the
300 // CopyTextureCHROMIUM call is processed before issuing any commands 300 // CopyTextureCHROMIUM call is processed before issuing any commands
301 // that will read from the target texture on a different context. 301 // that will read from the target texture on a different context.
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 texture_ = std::move(texture); 559 texture_ = std::move(texture);
560 } 560 }
561 561
562 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) { 562 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) {
563 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture"); 563 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture");
564 contents_texture_ = std::move(texture); 564 contents_texture_ = std::move(texture);
565 Release(); 565 Release();
566 } 566 }
567 567
568 } // namespace exo 568 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698