Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
| 8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" |
| 9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
| 10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
| (...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1999 { | 1999 { |
| 2000 if (isContextLost()) | 2000 if (isContextLost()) |
| 2001 return nullptr; | 2001 return nullptr; |
| 2002 WebGLTransformFeedback* o = WebGLTransformFeedback::create(this); | 2002 WebGLTransformFeedback* o = WebGLTransformFeedback::create(this); |
| 2003 addSharedObject(o); | 2003 addSharedObject(o); |
| 2004 return o; | 2004 return o; |
| 2005 } | 2005 } |
| 2006 | 2006 |
| 2007 void WebGL2RenderingContextBase::deleteTransformFeedback(WebGLTransformFeedback* feedback) | 2007 void WebGL2RenderingContextBase::deleteTransformFeedback(WebGLTransformFeedback* feedback) |
| 2008 { | 2008 { |
| 2009 if (transformFeedbackActive()) { | |
| 2010 synthesizeGLError(GL_INVALID_OPERATION, "deleteTransformFeedback", "tran sform feedback is active"); | |
| 2011 return; | |
| 2012 } | |
| 2009 if (feedback == m_transformFeedbackBinding) | 2013 if (feedback == m_transformFeedbackBinding) |
| 2010 m_transformFeedbackBinding = nullptr; | 2014 m_transformFeedbackBinding = nullptr; |
| 2011 | 2015 |
| 2012 deleteObject(feedback); | 2016 deleteObject(feedback); |
| 2013 } | 2017 } |
| 2014 | 2018 |
| 2015 GLboolean WebGL2RenderingContextBase::isTransformFeedback(WebGLTransformFeedback * feedback) | 2019 GLboolean WebGL2RenderingContextBase::isTransformFeedback(WebGLTransformFeedback * feedback) |
| 2016 { | 2020 { |
| 2017 if (isContextLost() || !feedback) | 2021 if (isContextLost() || !feedback) |
| 2018 return 0; | 2022 return 0; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2219 if (!validateAndUpdateBufferBindBaseTarget("bindBufferBase", target, index, buffer)) | 2223 if (!validateAndUpdateBufferBindBaseTarget("bindBufferBase", target, index, buffer)) |
| 2220 return; | 2224 return; |
| 2221 | 2225 |
| 2222 // ES 3.0.4 spec section 2.15.2 "Transform Feedback Primitive Capture" | 2226 // ES 3.0.4 spec section 2.15.2 "Transform Feedback Primitive Capture" |
| 2223 if (target == GL_TRANSFORM_FEEDBACK_BUFFER && transformFeedbackActive()) { | 2227 if (target == GL_TRANSFORM_FEEDBACK_BUFFER && transformFeedbackActive()) { |
| 2224 synthesizeGLError(GL_INVALID_OPERATION, "bindBufferBase", "target is TRA NSFORM_FEEDBACK_BUFFER and transform feedback is active"); | 2228 synthesizeGLError(GL_INVALID_OPERATION, "bindBufferBase", "target is TRA NSFORM_FEEDBACK_BUFFER and transform feedback is active"); |
| 2225 return; | 2229 return; |
| 2226 } | 2230 } |
| 2227 | 2231 |
| 2228 webContext()->bindBufferBase(target, index, objectOrZero(buffer)); | 2232 webContext()->bindBufferBase(target, index, objectOrZero(buffer)); |
| 2233 webContext()->bindBuffer(target, objectOrZero(buffer)); | |
|
Zhenyao Mo
2016/03/01 22:33:01
I am not sure this is the right fix.
I don't thin
qiankun
2016/03/01 23:52:06
The driver really call bindBuffer() when do bindBu
| |
| 2229 } | 2234 } |
| 2230 | 2235 |
| 2231 void WebGL2RenderingContextBase::bindBufferRange(GLenum target, GLuint index, We bGLBuffer* buffer, long long offset, long long size) | 2236 void WebGL2RenderingContextBase::bindBufferRange(GLenum target, GLuint index, We bGLBuffer* buffer, long long offset, long long size) |
| 2232 { | 2237 { |
| 2233 if (isContextLost()) | 2238 if (isContextLost()) |
| 2234 return; | 2239 return; |
| 2235 bool deleted; | 2240 bool deleted; |
| 2236 if (!checkObjectToBeBound("bindBufferRange", buffer, deleted)) | 2241 if (!checkObjectToBeBound("bindBufferRange", buffer, deleted)) |
| 2237 return; | 2242 return; |
| 2238 if (deleted) | 2243 if (deleted) |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3433 params.alignment = m_unpackAlignment; | 3438 params.alignment = m_unpackAlignment; |
| 3434 params.rowLength = m_unpackRowLength; | 3439 params.rowLength = m_unpackRowLength; |
| 3435 params.imageHeight = m_unpackImageHeight; | 3440 params.imageHeight = m_unpackImageHeight; |
| 3436 params.skipPixels = m_unpackSkipPixels; | 3441 params.skipPixels = m_unpackSkipPixels; |
| 3437 params.skipRows = m_unpackSkipRows; | 3442 params.skipRows = m_unpackSkipRows; |
| 3438 params.skipImages = m_unpackSkipImages; | 3443 params.skipImages = m_unpackSkipImages; |
| 3439 return params; | 3444 return params; |
| 3440 } | 3445 } |
| 3441 | 3446 |
| 3442 } // namespace blink | 3447 } // namespace blink |
| OLD | NEW |