| 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/framebuffer_manager.h" | 5 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.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/renderbuffer_manager.h" | 9 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 10 #include "gpu/command_buffer/service/texture_manager.h" | 10 #include "gpu/command_buffer/service/texture_manager.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 Renderbuffer* renderbuffer() const { | 112 Renderbuffer* renderbuffer() const { |
| 113 return renderbuffer_.get(); | 113 return renderbuffer_.get(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 virtual void AddToSignature( | 116 virtual void AddToSignature( |
| 117 TextureManager* texture_manager, std::string* signature) const OVERRIDE { | 117 TextureManager* texture_manager, std::string* signature) const OVERRIDE { |
| 118 DCHECK(signature); | 118 DCHECK(signature); |
| 119 renderbuffer_->AddToSignature(signature); | 119 renderbuffer_->AddToSignature(signature); |
| 120 } | 120 } |
| 121 | 121 |
| 122 virtual void OnWillRenderTo() const OVERRIDE {} |
| 123 virtual void OnDidRenderTo() const OVERRIDE {} |
| 124 |
| 122 protected: | 125 protected: |
| 123 virtual ~RenderbufferAttachment() { } | 126 virtual ~RenderbufferAttachment() { } |
| 124 | 127 |
| 125 private: | 128 private: |
| 126 scoped_refptr<Renderbuffer> renderbuffer_; | 129 scoped_refptr<Renderbuffer> renderbuffer_; |
| 127 | 130 |
| 128 DISALLOW_COPY_AND_ASSIGN(RenderbufferAttachment); | 131 DISALLOW_COPY_AND_ASSIGN(RenderbufferAttachment); |
| 129 }; | 132 }; |
| 130 | 133 |
| 131 class TextureAttachment | 134 class TextureAttachment |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 return (need & have) != 0; | 239 return (need & have) != 0; |
| 237 } | 240 } |
| 238 | 241 |
| 239 virtual void AddToSignature( | 242 virtual void AddToSignature( |
| 240 TextureManager* texture_manager, std::string* signature) const OVERRIDE { | 243 TextureManager* texture_manager, std::string* signature) const OVERRIDE { |
| 241 DCHECK(signature); | 244 DCHECK(signature); |
| 242 texture_manager->AddToSignature( | 245 texture_manager->AddToSignature( |
| 243 texture_ref_.get(), target_, level_, signature); | 246 texture_ref_.get(), target_, level_, signature); |
| 244 } | 247 } |
| 245 | 248 |
| 249 virtual void OnWillRenderTo() const OVERRIDE { |
| 250 texture_ref_->texture()->OnWillModifyPixels(); |
| 251 } |
| 252 |
| 253 virtual void OnDidRenderTo() const OVERRIDE { |
| 254 texture_ref_->texture()->OnDidModifyPixels(); |
| 255 } |
| 256 |
| 246 protected: | 257 protected: |
| 247 virtual ~TextureAttachment() {} | 258 virtual ~TextureAttachment() {} |
| 248 | 259 |
| 249 private: | 260 private: |
| 250 scoped_refptr<TextureRef> texture_ref_; | 261 scoped_refptr<TextureRef> texture_ref_; |
| 251 GLenum target_; | 262 GLenum target_; |
| 252 GLint level_; | 263 GLint level_; |
| 253 GLsizei samples_; | 264 GLsizei samples_; |
| 254 | 265 |
| 255 DISALLOW_COPY_AND_ASSIGN(TextureAttachment); | 266 DISALLOW_COPY_AND_ASSIGN(TextureAttachment); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 ++it) { | 670 ++it) { |
| 660 TextureDetachObserver* observer = *it; | 671 TextureDetachObserver* observer = *it; |
| 661 observer->OnTextureRefDetachedFromFramebuffer(texture); | 672 observer->OnTextureRefDetachedFromFramebuffer(texture); |
| 662 } | 673 } |
| 663 } | 674 } |
| 664 | 675 |
| 665 } // namespace gles2 | 676 } // namespace gles2 |
| 666 } // namespace gpu | 677 } // namespace gpu |
| 667 | 678 |
| 668 | 679 |
| OLD | NEW |