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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 : version_(version), | 354 : version_(version), |
355 target_(texture->target()), | 355 target_(texture->target()), |
356 image_buffer_(image_buffer), | 356 image_buffer_(image_buffer), |
357 min_filter_(texture->min_filter()), | 357 min_filter_(texture->min_filter()), |
358 mag_filter_(texture->mag_filter()), | 358 mag_filter_(texture->mag_filter()), |
359 wrap_s_(texture->wrap_s()), | 359 wrap_s_(texture->wrap_s()), |
360 wrap_t_(texture->wrap_t()), | 360 wrap_t_(texture->wrap_t()), |
361 usage_(texture->usage()), | 361 usage_(texture->usage()), |
362 immutable_(texture->IsImmutable()), | 362 immutable_(texture->IsImmutable()), |
363 defined_(texture->IsDefined()) { | 363 defined_(texture->IsDefined()) { |
364 DCHECK_IMPLIES(image_buffer_.get(), defined_); | 364 DCHECK(!image_buffer_.get() || defined_); |
365 if (!image_buffer_.get() && defined_) { | 365 if (!image_buffer_.get() && defined_) { |
366 image_buffer_ = NativeImageBuffer::Create(texture->service_id()); | 366 image_buffer_ = NativeImageBuffer::Create(texture->service_id()); |
367 DCHECK(image_buffer_.get()); | 367 DCHECK(image_buffer_.get()); |
368 } | 368 } |
369 | 369 |
370 const Texture::FaceInfo& first_face = texture->face_infos_[0]; | 370 const Texture::FaceInfo& first_face = texture->face_infos_[0]; |
371 if (image_buffer_.get()) { | 371 if (image_buffer_.get()) { |
372 scoped_refptr<gfx::GLImage> gl_image( | 372 scoped_refptr<gfx::GLImage> gl_image( |
373 new GLImageSync(image_buffer_, | 373 new GLImageSync(image_buffer_, |
374 gfx::Size(first_face.level_infos[0].width, | 374 gfx::Size(first_face.level_infos[0].width, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 return true; | 488 return true; |
489 } | 489 } |
490 | 490 |
491 bool TextureDefinition::SafeToRenderFrom() const { | 491 bool TextureDefinition::SafeToRenderFrom() const { |
492 return level_info_.cleared_rect.Contains( | 492 return level_info_.cleared_rect.Contains( |
493 gfx::Rect(level_info_.width, level_info_.height)); | 493 gfx::Rect(level_info_.width, level_info_.height)); |
494 } | 494 } |
495 | 495 |
496 } // namespace gles2 | 496 } // namespace gles2 |
497 } // namespace gpu | 497 } // namespace gpu |
OLD | NEW |