Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2698863002: Implement WebGL2's uniform*() with sub source. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 bool validateBlendFuncFactors(const char* functionName, 1350 bool validateBlendFuncFactors(const char* functionName,
1351 GLenum src, 1351 GLenum src,
1352 GLenum dst); 1352 GLenum dst);
1353 1353
1354 // Helper function to validate a GL capability. 1354 // Helper function to validate a GL capability.
1355 virtual bool validateCapability(const char* functionName, GLenum); 1355 virtual bool validateCapability(const char* functionName, GLenum);
1356 1356
1357 // Helper function to validate input parameters for uniform functions. 1357 // Helper function to validate input parameters for uniform functions.
1358 bool validateUniformParameters(const char* functionName, 1358 bool validateUniformParameters(const char* functionName,
1359 const WebGLUniformLocation*, 1359 const WebGLUniformLocation*,
1360 DOMFloat32Array*,
1361 GLsizei mod);
1362 bool validateUniformParameters(const char* functionName,
1363 const WebGLUniformLocation*,
1364 DOMInt32Array*,
1365 GLsizei mod);
1366 bool validateUniformParameters(const char* functionName,
1367 const WebGLUniformLocation*,
1368 void*, 1360 void*,
1369 GLsizei, 1361 GLsizei,
1370 GLsizei mod); 1362 GLsizei mod,
1363 GLuint srcOffset,
1364 GLuint srcLength);
1371 bool validateUniformMatrixParameters(const char* functionName, 1365 bool validateUniformMatrixParameters(const char* functionName,
1372 const WebGLUniformLocation*, 1366 const WebGLUniformLocation*,
1373 GLboolean transpose, 1367 GLboolean transpose,
1374 DOMFloat32Array*, 1368 DOMFloat32Array*,
1375 GLsizei mod); 1369 GLsizei mod,
1370 GLuint srcOffset,
1371 GLuint srcLength);
1376 bool validateUniformMatrixParameters(const char* functionName, 1372 bool validateUniformMatrixParameters(const char* functionName,
1377 const WebGLUniformLocation*, 1373 const WebGLUniformLocation*,
1378 GLboolean transpose, 1374 GLboolean transpose,
1379 void*, 1375 void*,
1380 GLsizei, 1376 GLsizei,
1381 GLsizei mod); 1377 GLsizei mod,
1378 GLuint srcOffset,
1379 GLuint srcLength);
1382 1380
1383 template <typename WTFTypedArray> 1381 template <typename WTFTypedArray>
1384 bool validateUniformParameters( 1382 bool validateUniformParameters(
1385 const char* functionName, 1383 const char* functionName,
1386 const WebGLUniformLocation* location, 1384 const WebGLUniformLocation* location,
1387 const TypedFlexibleArrayBufferView<WTFTypedArray>& v, 1385 const TypedFlexibleArrayBufferView<WTFTypedArray>& v,
1388 GLsizei requiredMinSize) { 1386 GLsizei requiredMinSize,
1387 GLuint srcOffset,
1388 GLuint srcLength) {
1389 if (!v.dataMaybeOnStack()) { 1389 if (!v.dataMaybeOnStack()) {
1390 synthesizeGLError(GL_INVALID_VALUE, functionName, "no array"); 1390 synthesizeGLError(GL_INVALID_VALUE, functionName, "no array");
1391 return false; 1391 return false;
1392 } 1392 }
1393 return validateUniformMatrixParameters(functionName, location, false, 1393 return validateUniformMatrixParameters(
1394 v.dataMaybeOnStack(), v.length(), 1394 functionName, location, false, v.dataMaybeOnStack(), v.length(),
1395 requiredMinSize); 1395 requiredMinSize, srcOffset, srcLength);
1396 } 1396 }
1397 1397
1398 // Helper function to validate the target for bufferData and 1398 // Helper function to validate the target for bufferData and
1399 // getBufferParameter. 1399 // getBufferParameter.
1400 virtual bool validateBufferTarget(const char* functionName, GLenum target); 1400 virtual bool validateBufferTarget(const char* functionName, GLenum target);
1401 1401
1402 // Helper function to validate the target for bufferData. 1402 // Helper function to validate the target for bufferData.
1403 // Return the current bound buffer to target, or 0 if the target is invalid. 1403 // Return the current bound buffer to target, or 0 if the target is invalid.
1404 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, 1404 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName,
1405 GLenum target); 1405 GLenum target);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 context, 1666 context,
1667 context->is3d(), 1667 context->is3d(),
1668 context.is3d()); 1668 context.is3d());
1669 1669
1670 } // namespace blink 1670 } // namespace blink
1671 1671
1672 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( 1672 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(
1673 blink::WebGLRenderingContextBase::TextureUnitState); 1673 blink::WebGLRenderingContextBase::TextureUnitState);
1674 1674
1675 #endif // WebGLRenderingContextBase_h 1675 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698