| 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 "content/common/gpu/client/gl_helper.h" | 5 #include "content/common/gpu/client/gl_helper.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 context_->getShaderiv(shader, GL_COMPILE_STATUS, &compile_status); | 708 context_->getShaderiv(shader, GL_COMPILE_STATUS, &compile_status); |
| 709 if (!compile_status) { | 709 if (!compile_status) { |
| 710 LOG(ERROR) << std::string(context_->getShaderInfoLog(shader).utf8()); | 710 LOG(ERROR) << std::string(context_->getShaderInfoLog(shader).utf8()); |
| 711 return 0; | 711 return 0; |
| 712 } | 712 } |
| 713 return shader.Detach(); | 713 return shader.Detach(); |
| 714 } | 714 } |
| 715 | 715 |
| 716 void GLHelper::InitCopyTextToImpl() { | 716 void GLHelper::InitCopyTextToImpl() { |
| 717 // Lazily initialize |copy_texture_to_impl_| | 717 // Lazily initialize |copy_texture_to_impl_| |
| 718 if (!copy_texture_to_impl_.get()) | 718 if (!copy_texture_to_impl_) |
| 719 copy_texture_to_impl_.reset(new CopyTextureToImpl(context_, this)); | 719 copy_texture_to_impl_.reset(new CopyTextureToImpl(context_, this)); |
| 720 } | 720 } |
| 721 | 721 |
| 722 void GLHelper::CopySubBufferDamage(WebKit::WebGLId texture, | 722 void GLHelper::CopySubBufferDamage(WebKit::WebGLId texture, |
| 723 WebKit::WebGLId previous_texture, | 723 WebKit::WebGLId previous_texture, |
| 724 const SkRegion& new_damage, | 724 const SkRegion& new_damage, |
| 725 const SkRegion& old_damage) { | 725 const SkRegion& old_damage) { |
| 726 SkRegion region(old_damage); | 726 SkRegion region(old_damage); |
| 727 if (region.op(new_damage, SkRegion::kDifference_Op)) { | 727 if (region.op(new_damage, SkRegion::kDifference_Op)) { |
| 728 ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer()); | 728 ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer()); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 739 context_->copyTexSubImage2D(GL_TEXTURE_2D, 0, | 739 context_->copyTexSubImage2D(GL_TEXTURE_2D, 0, |
| 740 rect.x(), rect.y(), | 740 rect.x(), rect.y(), |
| 741 rect.x(), rect.y(), | 741 rect.x(), rect.y(), |
| 742 rect.width(), rect.height()); | 742 rect.width(), rect.height()); |
| 743 } | 743 } |
| 744 context_->flush(); | 744 context_->flush(); |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 } // namespace content | 748 } // namespace content |
| OLD | NEW |