Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 587 PersistentWillBeMember<WebGLTexture> m_blackTexture2D; | 587 PersistentWillBeMember<WebGLTexture> m_blackTexture2D; |
| 588 PersistentWillBeMember<WebGLTexture> m_blackTextureCubeMap; | 588 PersistentWillBeMember<WebGLTexture> m_blackTextureCubeMap; |
| 589 | 589 |
| 590 Vector<GLenum> m_compressedTextureFormats; | 590 Vector<GLenum> m_compressedTextureFormats; |
| 591 | 591 |
| 592 // Fixed-size cache of reusable image buffers for video texImage2D calls. | 592 // Fixed-size cache of reusable image buffers for video texImage2D calls. |
| 593 class LRUImageBufferCache { | 593 class LRUImageBufferCache { |
| 594 public: | 594 public: |
| 595 LRUImageBufferCache(int capacity); | 595 LRUImageBufferCache(int capacity); |
| 596 // The pointer returned is owned by the image buffer map. | 596 // The pointer returned is owned by the image buffer map. |
| 597 ImageBuffer* imageBuffer(const IntSize& size); | 597 ImageBuffer* imageBuffer(const IntSize&); |
|
Ken Russell (switch to Gerrit)
2015/09/30 21:43:37
This change was required to pass the presubmit che
| |
| 598 private: | 598 private: |
| 599 void bubbleToFront(int idx); | 599 void bubbleToFront(int idx); |
| 600 OwnPtr<OwnPtr<ImageBuffer>[]> m_buffers; | 600 OwnPtr<OwnPtr<ImageBuffer>[]> m_buffers; |
| 601 int m_capacity; | 601 int m_capacity; |
| 602 }; | 602 }; |
| 603 LRUImageBufferCache m_generatedImageCache; | 603 LRUImageBufferCache m_generatedImageCache; |
| 604 | 604 |
| 605 GLint m_maxTextureSize; | 605 GLint m_maxTextureSize; |
| 606 GLint m_maxCubeMapTextureSize; | 606 GLint m_maxCubeMapTextureSize; |
| 607 GLint m_maxRenderbufferSize; | 607 GLint m_maxRenderbufferSize; |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 996 virtual bool validateCapability(const char* functionName, GLenum); | 996 virtual bool validateCapability(const char* functionName, GLenum); |
| 997 | 997 |
| 998 // Helper function to validate input parameters for uniform functions. | 998 // Helper function to validate input parameters for uniform functions. |
| 999 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, DOMFloat32Array*, GLsizei mod); | 999 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, DOMFloat32Array*, GLsizei mod); |
| 1000 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, DOMInt32Array*, GLsizei mod); | 1000 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, DOMInt32Array*, GLsizei mod); |
| 1001 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, void*, GLsizei, GLsizei mod); | 1001 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation*, void*, GLsizei, GLsizei mod); |
| 1002 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn iformLocation*, GLboolean transpose, DOMFloat32Array*, GLsizei mod); | 1002 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn iformLocation*, GLboolean transpose, DOMFloat32Array*, GLsizei mod); |
| 1003 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn iformLocation*, GLboolean transpose, void*, GLsizei, GLsizei mod); | 1003 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn iformLocation*, GLboolean transpose, void*, GLsizei, GLsizei mod); |
| 1004 | 1004 |
| 1005 template<typename WTFTypedArray> | 1005 template<typename WTFTypedArray> |
| 1006 bool validateUniformParameters(const char*, const WebGLUniformLocation*, co nst TypedFlexibleArrayBufferView<WTFTypedArray>&, GLsizei); | 1006 bool validateUniformParameters(const char* functionName, const WebGLUniformL ocation* location, const TypedFlexibleArrayBufferView<WTFTypedArray>& v, GLsizei requiredMinSize) |
| 1007 { | |
| 1008 if (!v.dataMaybeOnStack()) { | |
| 1009 synthesizeGLError(GL_INVALID_VALUE, functionName, "no array"); | |
| 1010 return false; | |
| 1011 } | |
| 1012 return validateUniformMatrixParameters(functionName, location, false, v. dataMaybeOnStack(), v.length(), requiredMinSize); | |
| 1013 } | |
| 1007 | 1014 |
| 1008 // Helper function to validate the target for bufferData and getBufferParame ter. | 1015 // Helper function to validate the target for bufferData and getBufferParame ter. |
| 1009 virtual bool validateBufferTarget(const char* functionName, GLenum target); | 1016 virtual bool validateBufferTarget(const char* functionName, GLenum target); |
| 1010 | 1017 |
| 1011 // Helper function to validate the target for bufferData. | 1018 // Helper function to validate the target for bufferData. |
| 1012 // Return the current bound buffer to target, or 0 if the target is invalid. | 1019 // Return the current bound buffer to target, or 0 if the target is invalid. |
| 1013 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, GLen um target); | 1020 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, GLen um target); |
| 1014 // Helper function to validate the usage for bufferData. | 1021 // Helper function to validate the usage for bufferData. |
| 1015 virtual bool validateBufferDataUsage(const char* functionName, GLenum usage) ; | 1022 virtual bool validateBufferDataUsage(const char* functionName, GLenum usage) ; |
| 1016 | 1023 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1036 // Helper function to validate draw*Instanced calls | 1043 // Helper function to validate draw*Instanced calls |
| 1037 bool validateDrawInstanced(const char* functionName, GLsizei primcount); | 1044 bool validateDrawInstanced(const char* functionName, GLsizei primcount); |
| 1038 | 1045 |
| 1039 // Helper functions for vertexAttribNf{v}. | 1046 // Helper functions for vertexAttribNf{v}. |
| 1040 void vertexAttribfImpl(const char* functionName, GLuint index, GLsizei expec tedSize, GLfloat, GLfloat, GLfloat, GLfloat); | 1047 void vertexAttribfImpl(const char* functionName, GLuint index, GLsizei expec tedSize, GLfloat, GLfloat, GLfloat, GLfloat); |
| 1041 void vertexAttribfvImpl(const char* functionName, GLuint index, const DOMFlo at32Array*, GLsizei expectedSize); | 1048 void vertexAttribfvImpl(const char* functionName, GLuint index, const DOMFlo at32Array*, GLsizei expectedSize); |
| 1042 void vertexAttribfvImpl(const char* functionName, GLuint index, const GLfloa t*, GLsizei, GLsizei expectedSize); | 1049 void vertexAttribfvImpl(const char* functionName, GLuint index, const GLfloa t*, GLsizei, GLsizei expectedSize); |
| 1043 | 1050 |
| 1044 // Helper functions to bufferData() and bufferSubData(). | 1051 // Helper functions to bufferData() and bufferSubData(). |
| 1045 void bufferDataImpl(GLenum target, long long size, const void* data, GLenum usage); | 1052 void bufferDataImpl(GLenum target, long long size, const void* data, GLenum usage); |
| 1046 void bufferSubDataImpl(GLenum target, long long offset, GLsizeiptr size, con st void* data); | 1053 void bufferSubDataImpl(GLenum target, long long offset, GLsizeiptr, const vo id* data); |
|
Ken Russell (switch to Gerrit)
2015/09/30 21:43:37
This one too.
| |
| 1047 | 1054 |
| 1048 // Helper function for delete* (deleteBuffer, deleteProgram, etc) functions. | 1055 // Helper function for delete* (deleteBuffer, deleteProgram, etc) functions. |
| 1049 // Return false if caller should return without further processing. | 1056 // Return false if caller should return without further processing. |
| 1050 bool deleteObject(WebGLObject*); | 1057 bool deleteObject(WebGLObject*); |
| 1051 | 1058 |
| 1052 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram. | 1059 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram. |
| 1053 // If the object has already been deleted, set deleted to true upon return. | 1060 // If the object has already been deleted, set deleted to true upon return. |
| 1054 // Return false if caller should return without further processing. | 1061 // Return false if caller should return without further processing. |
| 1055 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele ted); | 1062 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele ted); |
| 1056 | 1063 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1115 static IntSize oldestContextSize(); | 1122 static IntSize oldestContextSize(); |
| 1116 }; | 1123 }; |
| 1117 | 1124 |
| 1118 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); | 1125 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); |
| 1119 | 1126 |
| 1120 } // namespace blink | 1127 } // namespace blink |
| 1121 | 1128 |
| 1122 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); | 1129 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); |
| 1123 | 1130 |
| 1124 #endif // WebGLRenderingContextBase_h | 1131 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |