OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return this._functionName; | 399 return this._functionName; |
400 }, | 400 }, |
401 | 401 |
402 /** | 402 /** |
403 * @return {boolean} | 403 * @return {boolean} |
404 */ | 404 */ |
405 isPropertySetter: function() | 405 isPropertySetter: function() |
406 { | 406 { |
407 return !this._functionName; | 407 return !this._functionName; |
408 }, | 408 }, |
409 | 409 |
410 /** | 410 /** |
411 * @return {!Array} | 411 * @return {!Array} |
412 */ | 412 */ |
413 args: function() | 413 args: function() |
414 { | 414 { |
415 return this._args; | 415 return this._args; |
416 }, | 416 }, |
417 | 417 |
418 /** | 418 /** |
419 * @return {*} | 419 * @return {*} |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 var replayFunction = replayObject[replayableCall.functionName()]; | 525 var replayFunction = replayObject[replayableCall.functionName()]; |
526 console.assert(typeof replayFunction === "function", "Expected a fun
ction to replay"); | 526 console.assert(typeof replayFunction === "function", "Expected a fun
ction to replay"); |
527 replayResult = replayFunction.apply(replayObject, replayArgs); | 527 replayResult = replayFunction.apply(replayObject, replayArgs); |
528 | 528 |
529 if (replayableResult instanceof ReplayableResource) { | 529 if (replayableResult instanceof ReplayableResource) { |
530 var resource = replayableResult.replay(cache); | 530 var resource = replayableResult.replay(cache); |
531 if (!resource.wrappedObject()) | 531 if (!resource.wrappedObject()) |
532 resource.setWrappedObject(replayResult); | 532 resource.setWrappedObject(replayResult); |
533 } | 533 } |
534 } | 534 } |
535 | 535 |
536 this._thisObject = replayObject; | 536 this._thisObject = replayObject; |
537 this._functionName = replayableCall.functionName(); | 537 this._functionName = replayableCall.functionName(); |
538 this._args = replayArgs; | 538 this._args = replayArgs; |
539 this._result = replayResult; | 539 this._result = replayResult; |
540 this._stackTrace = replayableCall.stackTrace(); | 540 this._stackTrace = replayableCall.stackTrace(); |
541 this._freezed = true; | 541 this._freezed = true; |
542 var attachments = replayableCall.attachments(); | 542 var attachments = replayableCall.attachments(); |
543 this._attachments = attachments ? TypeUtils.cloneObject(attachments) : n
ull; | 543 this._attachments = attachments ? TypeUtils.cloneObject(attachments) : n
ull; |
544 return this; | 544 return this; |
545 } | 545 } |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 * @param {!Cache.<!Resource>} cache | 1694 * @param {!Cache.<!Resource>} cache |
1695 */ | 1695 */ |
1696 _doReplayCalls: function(data, cache) | 1696 _doReplayCalls: function(data, cache) |
1697 { | 1697 { |
1698 Resource.prototype._doReplayCalls.call(this, data, cache); | 1698 Resource.prototype._doReplayCalls.call(this, data, cache); |
1699 var gl = WebGLRenderingContextResource.forObject(this).wrappedObject(); | 1699 var gl = WebGLRenderingContextResource.forObject(this).wrappedObject(); |
1700 var program = this.wrappedObject(); | 1700 var program = this.wrappedObject(); |
1701 | 1701 |
1702 var originalProgram = /** @type {!WebGLProgram} */ (gl.getParameter(gl.C
URRENT_PROGRAM)); | 1702 var originalProgram = /** @type {!WebGLProgram} */ (gl.getParameter(gl.C
URRENT_PROGRAM)); |
1703 var currentProgram = originalProgram; | 1703 var currentProgram = originalProgram; |
1704 | 1704 |
1705 data.uniforms.forEach(function(uniform) { | 1705 data.uniforms.forEach(function(uniform) { |
1706 var uniformLocation = gl.getUniformLocation(program, uniform.name); | 1706 var uniformLocation = gl.getUniformLocation(program, uniform.name); |
1707 if (!uniformLocation) | 1707 if (!uniformLocation) |
1708 return; | 1708 return; |
1709 if (currentProgram !== program) { | 1709 if (currentProgram !== program) { |
1710 currentProgram = program; | 1710 currentProgram = program; |
1711 gl.useProgram(program); | 1711 gl.useProgram(program); |
1712 } | 1712 } |
1713 var methodName = this._uniformMethodNameByType(gl, uniform.type); | 1713 var methodName = this._uniformMethodNameByType(gl, uniform.type); |
1714 if (methodName.indexOf("Matrix") === -1) | 1714 if (methodName.indexOf("Matrix") === -1) |
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4574 } | 4574 } |
4575 return result; | 4575 return result; |
4576 }, | 4576 }, |
4577 | 4577 |
4578 /** | 4578 /** |
4579 * @param {string} stringId | 4579 * @param {string} stringId |
4580 * @return {{injectedScriptId: number, traceLogId: ?number, resourceId: ?num
ber}} | 4580 * @return {{injectedScriptId: number, traceLogId: ?number, resourceId: ?num
ber}} |
4581 */ | 4581 */ |
4582 _parseStringId: function(stringId) | 4582 _parseStringId: function(stringId) |
4583 { | 4583 { |
4584 return InjectedScriptHost.evaluate("(" + stringId + ")"); | 4584 return InjectedScriptHost.eval("(" + stringId + ")"); |
4585 } | 4585 } |
4586 } | 4586 } |
4587 | 4587 |
4588 var injectedCanvasModule = new InjectedCanvasModule(); | 4588 var injectedCanvasModule = new InjectedCanvasModule(); |
4589 return injectedCanvasModule; | 4589 return injectedCanvasModule; |
4590 | 4590 |
4591 }) | 4591 }) |
OLD | NEW |