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 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 if (isContextLost()) | 1443 if (isContextLost()) |
1444 return; | 1444 return; |
1445 m_clearStencil = s; | 1445 m_clearStencil = s; |
1446 webContext()->clearStencil(s); | 1446 webContext()->clearStencil(s); |
1447 } | 1447 } |
1448 | 1448 |
1449 void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool ean blue, GLboolean alpha) | 1449 void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool ean blue, GLboolean alpha) |
1450 { | 1450 { |
1451 if (isContextLost()) | 1451 if (isContextLost()) |
1452 return; | 1452 return; |
1453 // Disable alpha writes, if requested alpha attribute is false & backbuffer allocated as GL_RGBA | |
1454 if (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupporte d()) | |
1455 alpha = '\0'; | |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
That's a strange way to write that constant. Pleas
| |
1453 m_colorMask[0] = red; | 1456 m_colorMask[0] = red; |
1454 m_colorMask[1] = green; | 1457 m_colorMask[1] = green; |
1455 m_colorMask[2] = blue; | 1458 m_colorMask[2] = blue; |
1456 m_colorMask[3] = alpha; | 1459 m_colorMask[3] = alpha; |
1457 webContext()->colorMask(red, green, blue, alpha); | 1460 webContext()->colorMask(red, green, blue, alpha); |
1458 } | 1461 } |
1459 | 1462 |
1460 void WebGLRenderingContextBase::compileShader(WebGLShader* shader) | 1463 void WebGLRenderingContextBase::compileShader(WebGLShader* shader) |
1461 { | 1464 { |
1462 if (isContextLost() || !validateWebGLObject("compileShader", shader)) | 1465 if (isContextLost() || !validateWebGLObject("compileShader", shader)) |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2335 return ScriptValue::createNull(scriptState); | 2338 return ScriptValue::createNull(scriptState); |
2336 const int intZero = 0; | 2339 const int intZero = 0; |
2337 switch (pname) { | 2340 switch (pname) { |
2338 case GL_ACTIVE_TEXTURE: | 2341 case GL_ACTIVE_TEXTURE: |
2339 return getUnsignedIntParameter(scriptState, pname); | 2342 return getUnsignedIntParameter(scriptState, pname); |
2340 case GL_ALIASED_LINE_WIDTH_RANGE: | 2343 case GL_ALIASED_LINE_WIDTH_RANGE: |
2341 return getWebGLFloatArrayParameter(scriptState, pname); | 2344 return getWebGLFloatArrayParameter(scriptState, pname); |
2342 case GL_ALIASED_POINT_SIZE_RANGE: | 2345 case GL_ALIASED_POINT_SIZE_RANGE: |
2343 return getWebGLFloatArrayParameter(scriptState, pname); | 2346 return getWebGLFloatArrayParameter(scriptState, pname); |
2344 case GL_ALPHA_BITS: | 2347 case GL_ALPHA_BITS: |
2345 return getIntParameter(scriptState, pname); | 2348 // Report 0 bits, if requested alpha attribute is false & backbuffer all ocated as GL_RGBA |
2349 return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTexture Supported()) > 0 | |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
This is a strange way to write a boolean test. Ple
| |
2350 ? WebGLAny(scriptState, intZero) | |
2351 : getIntParameter(scriptState, pname); | |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
Please also fix up the query of COLOR_WRITEMASK.
| |
2346 case GL_ARRAY_BUFFER_BINDING: | 2352 case GL_ARRAY_BUFFER_BINDING: |
2347 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_bound ArrayBuffer.get())); | 2353 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_bound ArrayBuffer.get())); |
2348 case GL_BLEND: | 2354 case GL_BLEND: |
2349 return getBooleanParameter(scriptState, pname); | 2355 return getBooleanParameter(scriptState, pname); |
2350 case GL_BLEND_COLOR: | 2356 case GL_BLEND_COLOR: |
2351 return getWebGLFloatArrayParameter(scriptState, pname); | 2357 return getWebGLFloatArrayParameter(scriptState, pname); |
2352 case GL_BLEND_DST_ALPHA: | 2358 case GL_BLEND_DST_ALPHA: |
2353 return getUnsignedIntParameter(scriptState, pname); | 2359 return getUnsignedIntParameter(scriptState, pname); |
2354 case GL_BLEND_DST_RGB: | 2360 case GL_BLEND_DST_RGB: |
2355 return getUnsignedIntParameter(scriptState, pname); | 2361 return getUnsignedIntParameter(scriptState, pname); |
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6025 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; | 6031 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; |
6026 } | 6032 } |
6027 #else | 6033 #else |
6028 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6034 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6029 { | 6035 { |
6030 return m_drawingBuffer.get(); | 6036 return m_drawingBuffer.get(); |
6031 } | 6037 } |
6032 #endif | 6038 #endif |
6033 | 6039 |
6034 } // namespace blink | 6040 } // namespace blink |
OLD | NEW |