| 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 #include "base/bits.h" | 6 #include "base/bits.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 9 #include "gpu/command_buffer/service/context_state.h" | 9 #include "gpu/command_buffer/service/context_state.h" |
| 10 #include "gpu/command_buffer/service/error_state.h" | 10 #include "gpu/command_buffer/service/error_state.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 estimated_size(rhs.estimated_size) { | 191 estimated_size(rhs.estimated_size) { |
| 192 } | 192 } |
| 193 | 193 |
| 194 Texture::LevelInfo::~LevelInfo() { | 194 Texture::LevelInfo::~LevelInfo() { |
| 195 } | 195 } |
| 196 | 196 |
| 197 Texture::CanRenderCondition Texture::GetCanRenderCondition() const { | 197 Texture::CanRenderCondition Texture::GetCanRenderCondition() const { |
| 198 if (target_ == 0) | 198 if (target_ == 0) |
| 199 return CAN_RENDER_ALWAYS; | 199 return CAN_RENDER_ALWAYS; |
| 200 | 200 |
| 201 if (target_ == GL_TEXTURE_EXTERNAL_OES) { | 201 if (target_ != GL_TEXTURE_EXTERNAL_OES) { |
| 202 if (!IsStreamTexture()) { | |
| 203 return CAN_RENDER_NEVER; | |
| 204 } | |
| 205 } else { | |
| 206 if (level_infos_.empty()) { | 202 if (level_infos_.empty()) { |
| 207 return CAN_RENDER_NEVER; | 203 return CAN_RENDER_NEVER; |
| 208 } | 204 } |
| 209 | 205 |
| 210 const Texture::LevelInfo& first_face = level_infos_[0][0]; | 206 const Texture::LevelInfo& first_face = level_infos_[0][0]; |
| 211 if (first_face.width == 0 || | 207 if (first_face.width == 0 || |
| 212 first_face.height == 0 || | 208 first_face.height == 0 || |
| 213 first_face.depth == 0) { | 209 first_face.depth == 0) { |
| 214 return CAN_RENDER_NEVER; | 210 return CAN_RENDER_NEVER; |
| 215 } | 211 } |
| (...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 } | 1461 } |
| 1466 | 1462 |
| 1467 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { | 1463 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { |
| 1468 texture_state_->texture_upload_count++; | 1464 texture_state_->texture_upload_count++; |
| 1469 texture_state_->total_texture_upload_time += | 1465 texture_state_->total_texture_upload_time += |
| 1470 base::TimeTicks::HighResNow() - begin_time_; | 1466 base::TimeTicks::HighResNow() - begin_time_; |
| 1471 } | 1467 } |
| 1472 | 1468 |
| 1473 } // namespace gles2 | 1469 } // namespace gles2 |
| 1474 } // namespace gpu | 1470 } // namespace gpu |
| OLD | NEW |