OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 624 |
625 DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv, | 625 DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv, |
626 WGC3Denum, WGC3Denum, WGC3Dint*) | 626 WGC3Denum, WGC3Denum, WGC3Dint*) |
627 | 627 |
628 WebKit::WebGraphicsContext3D::Attributes | 628 WebKit::WebGraphicsContext3D::Attributes |
629 WebGraphicsContext3DCommandBufferImpl::getContextAttributes() { | 629 WebGraphicsContext3DCommandBufferImpl::getContextAttributes() { |
630 return attributes_; | 630 return attributes_; |
631 } | 631 } |
632 | 632 |
633 WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() { | 633 WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() { |
634 if (synthetic_errors_.size() > 0) { | 634 if (!synthetic_errors_.empty()) { |
635 std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin(); | 635 std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin(); |
636 WGC3Denum err = *iter; | 636 WGC3Denum err = *iter; |
637 synthetic_errors_.erase(iter); | 637 synthetic_errors_.erase(iter); |
638 return err; | 638 return err; |
639 } | 639 } |
640 | 640 |
641 makeContextCurrent(); | 641 makeContextCurrent(); |
642 return glGetError(); | 642 return glGetError(); |
643 } | 643 } |
644 | 644 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 context_lost_callback_ = cb; | 1014 context_lost_callback_ = cb; |
1015 } | 1015 } |
1016 | 1016 |
1017 void WebGraphicsContext3DCommandBufferImpl::OnContextLost() { | 1017 void WebGraphicsContext3DCommandBufferImpl::OnContextLost() { |
1018 if (context_lost_callback_) { | 1018 if (context_lost_callback_) { |
1019 context_lost_callback_->onContextLost(); | 1019 context_lost_callback_->onContextLost(); |
1020 } | 1020 } |
1021 } | 1021 } |
1022 | 1022 |
1023 #endif // defined(ENABLE_GPU) | 1023 #endif // defined(ENABLE_GPU) |
OLD | NEW |