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 <list> | 7 #include <list> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 : version_(version), | 327 : version_(version), |
328 target_(texture->target()), | 328 target_(texture->target()), |
329 image_buffer_(image_buffer), | 329 image_buffer_(image_buffer), |
330 min_filter_(texture->min_filter()), | 330 min_filter_(texture->min_filter()), |
331 mag_filter_(texture->mag_filter()), | 331 mag_filter_(texture->mag_filter()), |
332 wrap_s_(texture->wrap_s()), | 332 wrap_s_(texture->wrap_s()), |
333 wrap_t_(texture->wrap_t()), | 333 wrap_t_(texture->wrap_t()), |
334 usage_(texture->usage()), | 334 usage_(texture->usage()), |
335 immutable_(texture->IsImmutable()), | 335 immutable_(texture->IsImmutable()), |
336 defined_(texture->IsDefined()) { | 336 defined_(texture->IsDefined()) { |
337 DCHECK(!image_buffer_.get() || defined_); | 337 DCHECK_IMPLIES(image_buffer_.get(), defined_); |
338 if (!image_buffer_.get() && defined_) { | 338 if (!image_buffer_.get() && defined_) { |
339 image_buffer_ = NativeImageBuffer::Create(texture->service_id()); | 339 image_buffer_ = NativeImageBuffer::Create(texture->service_id()); |
340 DCHECK(image_buffer_.get()); | 340 DCHECK(image_buffer_.get()); |
341 } | 341 } |
342 | 342 |
343 const Texture::FaceInfo& first_face = texture->face_infos_[0]; | 343 const Texture::FaceInfo& first_face = texture->face_infos_[0]; |
344 if (image_buffer_.get()) { | 344 if (image_buffer_.get()) { |
345 scoped_refptr<gfx::GLImage> gl_image( | 345 scoped_refptr<gfx::GLImage> gl_image( |
346 new GLImageSync(image_buffer_, | 346 new GLImageSync(image_buffer_, |
347 gfx::Size(first_face.level_infos[0].width, | 347 gfx::Size(first_face.level_infos[0].width, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return true; | 455 return true; |
456 } | 456 } |
457 | 457 |
458 bool TextureDefinition::SafeToRenderFrom() const { | 458 bool TextureDefinition::SafeToRenderFrom() const { |
459 return level_info_.cleared_rect.Contains( | 459 return level_info_.cleared_rect.Contains( |
460 gfx::Rect(level_info_.width, level_info_.height)); | 460 gfx::Rect(level_info_.width, level_info_.height)); |
461 } | 461 } |
462 | 462 |
463 } // namespace gles2 | 463 } // namespace gles2 |
464 } // namespace gpu | 464 } // namespace gpu |
OLD | NEW |