| OLD | NEW |
| 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 "gpu/command_buffer/service/texture_definition.h" | 5 #include "gpu/command_buffer/service/texture_definition.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 internal_format(internal_format), | 303 internal_format(internal_format), |
| 304 width(width), | 304 width(width), |
| 305 height(height), | 305 height(height), |
| 306 depth(depth), | 306 depth(depth), |
| 307 border(border), | 307 border(border), |
| 308 format(format), | 308 format(format), |
| 309 type(type), | 309 type(type), |
| 310 cleared_rect(cleared_rect) { | 310 cleared_rect(cleared_rect) { |
| 311 } | 311 } |
| 312 | 312 |
| 313 TextureDefinition::LevelInfo::LevelInfo(const LevelInfo& other) = default; |
| 314 |
| 313 TextureDefinition::LevelInfo::~LevelInfo() {} | 315 TextureDefinition::LevelInfo::~LevelInfo() {} |
| 314 | 316 |
| 315 TextureDefinition::TextureDefinition() | 317 TextureDefinition::TextureDefinition() |
| 316 : version_(0), | 318 : version_(0), |
| 317 target_(0), | 319 target_(0), |
| 318 min_filter_(0), | 320 min_filter_(0), |
| 319 mag_filter_(0), | 321 mag_filter_(0), |
| 320 wrap_s_(0), | 322 wrap_s_(0), |
| 321 wrap_t_(0), | 323 wrap_t_(0), |
| 322 usage_(0), | 324 usage_(0), |
| (...skipping 27 matching lines...) Expand all Loading... |
| 350 first_face.level_infos[0].height))); | 352 first_face.level_infos[0].height))); |
| 351 texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND); | 353 texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND); |
| 352 } | 354 } |
| 353 | 355 |
| 354 const Texture::LevelInfo& level = first_face.level_infos[0]; | 356 const Texture::LevelInfo& level = first_face.level_infos[0]; |
| 355 level_info_ = LevelInfo(level.target, level.internal_format, level.width, | 357 level_info_ = LevelInfo(level.target, level.internal_format, level.width, |
| 356 level.height, level.depth, level.border, level.format, | 358 level.height, level.depth, level.border, level.format, |
| 357 level.type, level.cleared_rect); | 359 level.type, level.cleared_rect); |
| 358 } | 360 } |
| 359 | 361 |
| 362 TextureDefinition::TextureDefinition(const TextureDefinition& other) = default; |
| 363 |
| 360 TextureDefinition::~TextureDefinition() { | 364 TextureDefinition::~TextureDefinition() { |
| 361 } | 365 } |
| 362 | 366 |
| 363 Texture* TextureDefinition::CreateTexture() const { | 367 Texture* TextureDefinition::CreateTexture() const { |
| 364 GLuint texture_id; | 368 GLuint texture_id; |
| 365 glGenTextures(1, &texture_id); | 369 glGenTextures(1, &texture_id); |
| 366 | 370 |
| 367 Texture* texture(new Texture(texture_id)); | 371 Texture* texture(new Texture(texture_id)); |
| 368 UpdateTextureInternal(texture); | 372 UpdateTextureInternal(texture); |
| 369 | 373 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 return true; | 461 return true; |
| 458 } | 462 } |
| 459 | 463 |
| 460 bool TextureDefinition::SafeToRenderFrom() const { | 464 bool TextureDefinition::SafeToRenderFrom() const { |
| 461 return level_info_.cleared_rect.Contains( | 465 return level_info_.cleared_rect.Contains( |
| 462 gfx::Rect(level_info_.width, level_info_.height)); | 466 gfx::Rect(level_info_.width, level_info_.height)); |
| 463 } | 467 } |
| 464 | 468 |
| 465 } // namespace gles2 | 469 } // namespace gles2 |
| 466 } // namespace gpu | 470 } // namespace gpu |
| OLD | NEW |