| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 class GLImageSync : public gl::GLImage { | 28 class GLImageSync : public gl::GLImage { |
| 29 public: | 29 public: |
| 30 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer, | 30 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer, |
| 31 const gfx::Size& size); | 31 const gfx::Size& size); |
| 32 | 32 |
| 33 // Implement GLImage. | 33 // Implement GLImage. |
| 34 void Destroy(bool have_context) override; | 34 void Destroy(bool have_context) override; |
| 35 bool IsValid() override; |
| 35 gfx::Size GetSize() override; | 36 gfx::Size GetSize() override; |
| 36 unsigned GetInternalFormat() override; | 37 unsigned GetInternalFormat() override; |
| 37 bool BindTexImage(unsigned target) override; | 38 bool BindTexImage(unsigned target) override; |
| 38 void ReleaseTexImage(unsigned target) override; | 39 void ReleaseTexImage(unsigned target) override; |
| 39 bool CopyTexImage(unsigned target) override; | 40 bool CopyTexImage(unsigned target) override; |
| 40 bool CopyTexSubImage(unsigned target, | 41 bool CopyTexSubImage(unsigned target, |
| 41 const gfx::Point& offset, | 42 const gfx::Point& offset, |
| 42 const gfx::Rect& rect) override; | 43 const gfx::Rect& rect) override; |
| 43 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 44 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 44 int z_order, | 45 int z_order, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 67 } | 68 } |
| 68 | 69 |
| 69 GLImageSync::~GLImageSync() { | 70 GLImageSync::~GLImageSync() { |
| 70 if (buffer_.get()) | 71 if (buffer_.get()) |
| 71 buffer_->RemoveClient(this); | 72 buffer_->RemoveClient(this); |
| 72 } | 73 } |
| 73 | 74 |
| 74 void GLImageSync::Destroy(bool have_context) { | 75 void GLImageSync::Destroy(bool have_context) { |
| 75 } | 76 } |
| 76 | 77 |
| 78 bool GLImageSync::IsValid() { |
| 79 return true; |
| 80 } |
| 81 |
| 77 gfx::Size GLImageSync::GetSize() { | 82 gfx::Size GLImageSync::GetSize() { |
| 78 return size_; | 83 return size_; |
| 79 } | 84 } |
| 80 | 85 |
| 81 unsigned GLImageSync::GetInternalFormat() { | 86 unsigned GLImageSync::GetInternalFormat() { |
| 82 return GL_RGBA; | 87 return GL_RGBA; |
| 83 } | 88 } |
| 84 | 89 |
| 85 bool GLImageSync::BindTexImage(unsigned target) { | 90 bool GLImageSync::BindTexImage(unsigned target) { |
| 86 NOTREACHED(); | 91 NOTREACHED(); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 return true; | 459 return true; |
| 455 } | 460 } |
| 456 | 461 |
| 457 bool TextureDefinition::SafeToRenderFrom() const { | 462 bool TextureDefinition::SafeToRenderFrom() const { |
| 458 return level_info_.cleared_rect.Contains( | 463 return level_info_.cleared_rect.Contains( |
| 459 gfx::Rect(level_info_.width, level_info_.height)); | 464 gfx::Rect(level_info_.width, level_info_.height)); |
| 460 } | 465 } |
| 461 | 466 |
| 462 } // namespace gles2 | 467 } // namespace gles2 |
| 463 } // namespace gpu | 468 } // namespace gpu |
| OLD | NEW |