OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 mailbox_manager_->TextureDeleted(this); | 365 mailbox_manager_->TextureDeleted(this); |
366 mailbox_manager_ = nullptr; | 366 mailbox_manager_ = nullptr; |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 void TextureBase::SetMailboxManager(MailboxManager* mailbox_manager) { | 370 void TextureBase::SetMailboxManager(MailboxManager* mailbox_manager) { |
371 DCHECK(!mailbox_manager_ || mailbox_manager_ == mailbox_manager); | 371 DCHECK(!mailbox_manager_ || mailbox_manager_ == mailbox_manager); |
372 mailbox_manager_ = mailbox_manager; | 372 mailbox_manager_ = mailbox_manager; |
373 } | 373 } |
374 | 374 |
| 375 TexturePassthrough::TexturePassthrough(GLuint service_id) |
| 376 : TextureBase(service_id) {} |
| 377 |
| 378 TexturePassthrough::~TexturePassthrough() { |
| 379 DeleteFromMailboxManager(); |
| 380 glDeleteTextures(1, &service_id_); |
| 381 } |
| 382 |
375 Texture::Texture(GLuint service_id) | 383 Texture::Texture(GLuint service_id) |
376 : TextureBase(service_id), | 384 : TextureBase(service_id), |
377 memory_tracking_ref_(NULL), | 385 memory_tracking_ref_(NULL), |
378 owned_service_id_(service_id), | 386 owned_service_id_(service_id), |
379 cleared_(true), | 387 cleared_(true), |
380 num_uncleared_mips_(0), | 388 num_uncleared_mips_(0), |
381 num_npot_faces_(0), | 389 num_npot_faces_(0), |
382 target_(0), | 390 target_(0), |
383 usage_(GL_NONE), | 391 usage_(GL_NONE), |
384 base_level_(0), | 392 base_level_(0), |
(...skipping 3010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3395 uint32_t TextureManager::GetServiceIdGeneration() const { | 3403 uint32_t TextureManager::GetServiceIdGeneration() const { |
3396 return current_service_id_generation_; | 3404 return current_service_id_generation_; |
3397 } | 3405 } |
3398 | 3406 |
3399 void TextureManager::IncrementServiceIdGeneration() { | 3407 void TextureManager::IncrementServiceIdGeneration() { |
3400 current_service_id_generation_++; | 3408 current_service_id_generation_++; |
3401 } | 3409 } |
3402 | 3410 |
3403 } // namespace gles2 | 3411 } // namespace gles2 |
3404 } // namespace gpu | 3412 } // namespace gpu |
OLD | NEW |