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

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

Issue 2692853006: Implement WebGL2's uniform*() with sub source. (Closed)
Patch Set: clean up 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 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 bool validateBlendFuncFactors(const char* functionName, 1345 bool validateBlendFuncFactors(const char* functionName,
1346 GLenum src, 1346 GLenum src,
1347 GLenum dst); 1347 GLenum dst);
1348 1348
1349 // Helper function to validate a GL capability. 1349 // Helper function to validate a GL capability.
1350 virtual bool validateCapability(const char* functionName, GLenum); 1350 virtual bool validateCapability(const char* functionName, GLenum);
1351 1351
1352 // Helper function to validate input parameters for uniform functions. 1352 // Helper function to validate input parameters for uniform functions.
1353 bool validateUniformParameters(const char* functionName, 1353 bool validateUniformParameters(const char* functionName,
1354 const WebGLUniformLocation*, 1354 const WebGLUniformLocation*,
1355 DOMFloat32Array*,
1356 GLsizei mod);
1357 bool validateUniformParameters(const char* functionName,
1358 const WebGLUniformLocation*,
1359 DOMInt32Array*,
1360 GLsizei mod);
1361 bool validateUniformParameters(const char* functionName,
1362 const WebGLUniformLocation*,
1363 void*, 1355 void*,
1364 GLsizei, 1356 GLsizei,
1365 GLsizei mod); 1357 GLsizei mod,
1358 GLuint srcOffset,
1359 GLuint srcLength);
1366 bool validateUniformMatrixParameters(const char* functionName, 1360 bool validateUniformMatrixParameters(const char* functionName,
1367 const WebGLUniformLocation*, 1361 const WebGLUniformLocation*,
1368 GLboolean transpose, 1362 GLboolean transpose,
1369 DOMFloat32Array*, 1363 DOMFloat32Array*,
1370 GLsizei mod); 1364 GLsizei mod,
1365 GLuint srcOffset,
1366 GLuint srcLength);
1371 bool validateUniformMatrixParameters(const char* functionName, 1367 bool validateUniformMatrixParameters(const char* functionName,
1372 const WebGLUniformLocation*, 1368 const WebGLUniformLocation*,
1373 GLboolean transpose, 1369 GLboolean transpose,
1374 void*, 1370 void*,
1375 GLsizei, 1371 GLsizei,
1376 GLsizei mod); 1372 GLsizei mod,
1373 GLuint srcOffset,
1374 GLuint srcLength);
1377 1375
1378 template <typename WTFTypedArray> 1376 template <typename WTFTypedArray>
1379 bool validateUniformParameters( 1377 bool validateUniformParameters(
1380 const char* functionName, 1378 const char* functionName,
1381 const WebGLUniformLocation* location, 1379 const WebGLUniformLocation* location,
1382 const TypedFlexibleArrayBufferView<WTFTypedArray>& v, 1380 const TypedFlexibleArrayBufferView<WTFTypedArray>& v,
1383 GLsizei requiredMinSize) { 1381 GLsizei requiredMinSize,
1382 GLuint srcOffset,
1383 GLuint srcLength) {
1384 if (!v.dataMaybeOnStack()) { 1384 if (!v.dataMaybeOnStack()) {
1385 synthesizeGLError(GL_INVALID_VALUE, functionName, "no array"); 1385 synthesizeGLError(GL_INVALID_VALUE, functionName, "no array");
1386 return false; 1386 return false;
1387 } 1387 }
1388 return validateUniformMatrixParameters(functionName, location, false, 1388 return validateUniformMatrixParameters(
1389 v.dataMaybeOnStack(), v.length(), 1389 functionName, location, false, v.dataMaybeOnStack(), v.length(),
1390 requiredMinSize); 1390 requiredMinSize, srcOffset, srcLength);
1391 } 1391 }
1392 1392
1393 // Helper function to validate the target for bufferData and 1393 // Helper function to validate the target for bufferData and
1394 // getBufferParameter. 1394 // getBufferParameter.
1395 virtual bool validateBufferTarget(const char* functionName, GLenum target); 1395 virtual bool validateBufferTarget(const char* functionName, GLenum target);
1396 1396
1397 // Helper function to validate the target for bufferData. 1397 // Helper function to validate the target for bufferData.
1398 // Return the current bound buffer to target, or 0 if the target is invalid. 1398 // Return the current bound buffer to target, or 0 if the target is invalid.
1399 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, 1399 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName,
1400 GLenum target); 1400 GLenum target);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 context, 1662 context,
1663 context->is3d(), 1663 context->is3d(),
1664 context.is3d()); 1664 context.is3d());
1665 1665
1666 } // namespace blink 1666 } // namespace blink
1667 1667
1668 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( 1668 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(
1669 blink::WebGLRenderingContextBase::TextureUnitState); 1669 blink::WebGLRenderingContextBase::TextureUnitState);
1670 1670
1671 #endif // WebGLRenderingContextBase_h 1671 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698