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 5144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5155 return true; | 5155 return true; |
5156 } | 5156 } |
5157 | 5157 |
5158 bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName,
HTMLCanvasElement* canvas, ExceptionState& exceptionState) | 5158 bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName,
HTMLCanvasElement* canvas, ExceptionState& exceptionState) |
5159 { | 5159 { |
5160 if (!canvas || !canvas->buffer()) { | 5160 if (!canvas || !canvas->buffer()) { |
5161 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no ca
nvas"); | 5161 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no ca
nvas"); |
5162 return false; | 5162 return false; |
5163 } | 5163 } |
5164 if (wouldTaintOrigin(canvas)) { | 5164 if (wouldTaintOrigin(canvas)) { |
5165 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(fun
ctionName, "WebGLRenderingContext", "tainted canvases may not be loded.")); | 5165 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(fun
ctionName, "WebGLRenderingContext", "tainted canvases may not be loaded.")); |
5166 return false; | 5166 return false; |
5167 } | 5167 } |
5168 return true; | 5168 return true; |
5169 } | 5169 } |
5170 | 5170 |
5171 bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, H
TMLVideoElement* video, ExceptionState& exceptionState) | 5171 bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, H
TMLVideoElement* video, ExceptionState& exceptionState) |
5172 { | 5172 { |
5173 if (!video || !video->videoWidth() || !video->videoHeight()) { | 5173 if (!video || !video->videoWidth() || !video->videoHeight()) { |
5174 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no vi
deo"); | 5174 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no vi
deo"); |
5175 return false; | 5175 return false; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5616 if (m_textureUnits[i].m_texture2DBinding | 5616 if (m_textureUnits[i].m_texture2DBinding |
5617 || m_textureUnits[i].m_textureCubeMapBinding) { | 5617 || m_textureUnits[i].m_textureCubeMapBinding) { |
5618 m_onePlusMaxNonDefaultTextureUnit = i + 1; | 5618 m_onePlusMaxNonDefaultTextureUnit = i + 1; |
5619 return; | 5619 return; |
5620 } | 5620 } |
5621 } | 5621 } |
5622 m_onePlusMaxNonDefaultTextureUnit = 0; | 5622 m_onePlusMaxNonDefaultTextureUnit = 0; |
5623 } | 5623 } |
5624 | 5624 |
5625 } // namespace WebCore | 5625 } // namespace WebCore |
OLD | NEW |