| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsContext3DAtt
ributes(attributes, document.topDocument().url().string(), settings, webGLVersio
n); | 575 WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsContext3DAtt
ributes(attributes, document.topDocument().url().string(), settings, webGLVersio
n); |
| 576 WebGraphicsContext3D::WebGraphicsInfo glInfo; | 576 WebGraphicsContext3D::WebGraphicsInfo glInfo; |
| 577 glInfo.testFailContext = shouldFailContextCreationForTesting; | 577 glInfo.testFailContext = shouldFailContextCreationForTesting; |
| 578 OwnPtr<WebGraphicsContext3D> context = adoptPtr(Platform::current()->createO
ffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo)); | 578 OwnPtr<WebGraphicsContext3D> context = adoptPtr(Platform::current()->createO
ffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo)); |
| 579 if (!context || shouldFailContextCreationForTesting) { | 579 if (!context || shouldFailContextCreationForTesting) { |
| 580 shouldFailContextCreationForTesting = false; | 580 shouldFailContextCreationForTesting = false; |
| 581 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, extractWebGLContextCreationError(glInfo))); | 581 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, extractWebGLContextCreationError(glInfo))); |
| 582 return nullptr; | 582 return nullptr; |
| 583 } | 583 } |
| 584 if (context->getString(GL_EXTENSIONS).utf8().find("GL_OES_packed_depth_stenc
il") == std::string::npos) { |
| 585 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "OES_packed_depth_stencil support is required.")
); |
| 586 return nullptr; |
| 587 } |
| 584 | 588 |
| 585 return context.release(); | 589 return context.release(); |
| 586 } | 590 } |
| 587 | 591 |
| 588 void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail() | 592 void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail() |
| 589 { | 593 { |
| 590 shouldFailContextCreationForTesting = true; | 594 shouldFailContextCreationForTesting = true; |
| 591 } | 595 } |
| 592 | 596 |
| 593 namespace { | 597 namespace { |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 | 2043 |
| 2040 WebGLRenderbuffer* WebGLRenderingContextBase::createRenderbuffer() | 2044 WebGLRenderbuffer* WebGLRenderingContextBase::createRenderbuffer() |
| 2041 { | 2045 { |
| 2042 if (isContextLost()) | 2046 if (isContextLost()) |
| 2043 return nullptr; | 2047 return nullptr; |
| 2044 WebGLRenderbuffer* o = WebGLRenderbuffer::create(this); | 2048 WebGLRenderbuffer* o = WebGLRenderbuffer::create(this); |
| 2045 addSharedObject(o); | 2049 addSharedObject(o); |
| 2046 return o; | 2050 return o; |
| 2047 } | 2051 } |
| 2048 | 2052 |
| 2049 WebGLRenderbuffer* WebGLRenderingContextBase::ensureEmulatedStencilBuffer(GLenum
target, WebGLRenderbuffer* renderbuffer) | |
| 2050 { | |
| 2051 if (isContextLost()) | |
| 2052 return nullptr; | |
| 2053 if (!renderbuffer->emulatedStencilBuffer()) { | |
| 2054 renderbuffer->setEmulatedStencilBuffer(createRenderbuffer()); | |
| 2055 webContext()->bindRenderbuffer(target, objectOrZero(renderbuffer->emulat
edStencilBuffer())); | |
| 2056 webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBindin
g.get())); | |
| 2057 } | |
| 2058 return renderbuffer->emulatedStencilBuffer(); | |
| 2059 } | |
| 2060 | |
| 2061 const WebGLSamplerState* WebGLRenderingContextBase::getTextureUnitSamplerState(G
Lenum target, GLuint unit) const | 2053 const WebGLSamplerState* WebGLRenderingContextBase::getTextureUnitSamplerState(G
Lenum target, GLuint unit) const |
| 2062 { | 2054 { |
| 2063 ASSERT(unit < m_textureUnits.size()); | 2055 ASSERT(unit < m_textureUnits.size()); |
| 2064 | 2056 |
| 2065 WebGLTexture* texture = nullptr; | 2057 WebGLTexture* texture = nullptr; |
| 2066 | 2058 |
| 2067 switch (target) { | 2059 switch (target) { |
| 2068 case GL_TEXTURE_2D: | 2060 case GL_TEXTURE_2D: |
| 2069 texture = m_textureUnits[unit].m_texture2DBinding; | 2061 texture = m_textureUnits[unit].m_texture2DBinding; |
| 2070 break; | 2062 break; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2407 } | 2399 } |
| 2408 // Don't allow the default framebuffer to be mutated; all current | 2400 // Don't allow the default framebuffer to be mutated; all current |
| 2409 // implementations use an FBO internally in place of the default | 2401 // implementations use an FBO internally in place of the default |
| 2410 // FBO. | 2402 // FBO. |
| 2411 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); | 2403 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); |
| 2412 if (!framebufferBinding || !framebufferBinding->object()) { | 2404 if (!framebufferBinding || !framebufferBinding->object()) { |
| 2413 synthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", "no f
ramebuffer bound"); | 2405 synthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", "no f
ramebuffer bound"); |
| 2414 return; | 2406 return; |
| 2415 } | 2407 } |
| 2416 Platform3DObject bufferObject = objectOrZero(buffer); | 2408 Platform3DObject bufferObject = objectOrZero(buffer); |
| 2417 switch (attachment) { | |
| 2418 case GL_DEPTH_STENCIL_ATTACHMENT: | |
| 2419 if (isWebGL2OrHigher() || isDepthStencilSupported() || !buffer) { | |
| 2420 webContext()->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, r
enderbuffertarget, bufferObject); | |
| 2421 webContext()->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT,
renderbuffertarget, bufferObject); | |
| 2422 } else { | |
| 2423 WebGLRenderbuffer* emulatedStencilBuffer = ensureEmulatedStencilBuff
er(renderbuffertarget, buffer); | |
| 2424 if (!emulatedStencilBuffer) { | |
| 2425 synthesizeGLError(GL_OUT_OF_MEMORY, "framebufferRenderbuffer", "
out of memory"); | |
| 2426 return; | |
| 2427 } | |
| 2428 webContext()->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, r
enderbuffertarget, bufferObject); | |
| 2429 webContext()->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT,
renderbuffertarget, objectOrZero(emulatedStencilBuffer)); | |
| 2430 } | |
| 2431 break; | |
| 2432 default: | |
| 2433 webContext()->framebufferRenderbuffer(target, attachment, renderbufferta
rget, bufferObject); | |
| 2434 } | |
| 2435 if (isWebGL2OrHigher() && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { | 2409 if (isWebGL2OrHigher() && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| 2436 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. | 2410 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. |
| 2437 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. | 2411 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. |
| 2412 webContext()->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, rende
rbuffertarget, bufferObject); |
| 2413 webContext()->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, ren
derbuffertarget, bufferObject); |
| 2438 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, buffer); | 2414 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, buffer); |
| 2439 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, buffer); | 2415 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, buffer); |
| 2440 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, buffer); | 2416 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, buffer); |
| 2441 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, buffer); | 2417 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, buffer); |
| 2442 } else { | 2418 } else { |
| 2419 webContext()->framebufferRenderbuffer(target, attachment, renderbufferta
rget, bufferObject); |
| 2443 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
buffer); | 2420 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
buffer); |
| 2444 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", att
achment, buffer); | 2421 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", att
achment, buffer); |
| 2445 } | 2422 } |
| 2446 applyStencilTest(); | 2423 applyStencilTest(); |
| 2447 } | 2424 } |
| 2448 | 2425 |
| 2449 void WebGLRenderingContextBase::framebufferTexture2D(ScriptState* scriptState, G
Lenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint
level) | 2426 void WebGLRenderingContextBase::framebufferTexture2D(ScriptState* scriptState, G
Lenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint
level) |
| 2450 { | 2427 { |
| 2451 if (isContextLost() || !validateFramebufferFuncParameters("framebufferTextur
e2D", target, attachment)) | 2428 if (isContextLost() || !validateFramebufferFuncParameters("framebufferTextur
e2D", target, attachment)) |
| 2452 return; | 2429 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2463 } | 2440 } |
| 2464 // Don't allow the default framebuffer to be mutated; all current | 2441 // Don't allow the default framebuffer to be mutated; all current |
| 2465 // implementations use an FBO internally in place of the default | 2442 // implementations use an FBO internally in place of the default |
| 2466 // FBO. | 2443 // FBO. |
| 2467 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); | 2444 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); |
| 2468 if (!framebufferBinding || !framebufferBinding->object()) { | 2445 if (!framebufferBinding || !framebufferBinding->object()) { |
| 2469 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no fram
ebuffer bound"); | 2446 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no fram
ebuffer bound"); |
| 2470 return; | 2447 return; |
| 2471 } | 2448 } |
| 2472 Platform3DObject textureObject = objectOrZero(texture); | 2449 Platform3DObject textureObject = objectOrZero(texture); |
| 2473 switch (attachment) { | |
| 2474 case GL_DEPTH_STENCIL_ATTACHMENT: | |
| 2475 webContext()->framebufferTexture2D(target, GL_DEPTH_ATTACHMENT, textarge
t, textureObject, level); | |
| 2476 webContext()->framebufferTexture2D(target, GL_STENCIL_ATTACHMENT, textar
get, textureObject, level); | |
| 2477 break; | |
| 2478 default: | |
| 2479 webContext()->framebufferTexture2D(target, attachment, textarget, textur
eObject, level); | |
| 2480 } | |
| 2481 if (isWebGL2OrHigher() && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { | 2450 if (isWebGL2OrHigher() && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| 2482 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. | 2451 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. |
| 2483 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. | 2452 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. |
| 2453 webContext()->framebufferTexture2D(target, GL_DEPTH_ATTACHMENT, textarge
t, textureObject, level); |
| 2454 webContext()->framebufferTexture2D(target, GL_STENCIL_ATTACHMENT, textar
get, textureObject, level); |
| 2484 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, textarget, texture, level, 0); | 2455 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, textarget, texture, level, 0); |
| 2485 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, textarget, texture, level, 0); | 2456 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, textarget, texture, level, 0); |
| 2486 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, texture); | 2457 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, texture); |
| 2487 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, texture); | 2458 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, texture); |
| 2488 } else { | 2459 } else { |
| 2460 webContext()->framebufferTexture2D(target, attachment, textarget, textur
eObject, level); |
| 2489 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
textarget, texture, level, 0); | 2461 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
textarget, texture, level, 0); |
| 2490 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", att
achment, texture); | 2462 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", att
achment, texture); |
| 2491 } | 2463 } |
| 2492 applyStencilTest(); | 2464 applyStencilTest(); |
| 2493 } | 2465 } |
| 2494 | 2466 |
| 2495 void WebGLRenderingContextBase::frontFace(GLenum mode) | 2467 void WebGLRenderingContextBase::frontFace(GLenum mode) |
| 2496 { | 2468 { |
| 2497 if (isContextLost()) | 2469 if (isContextLost()) |
| 2498 return; | 2470 return; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3088 case GL_RENDERBUFFER_WIDTH: | 3060 case GL_RENDERBUFFER_WIDTH: |
| 3089 case GL_RENDERBUFFER_HEIGHT: | 3061 case GL_RENDERBUFFER_HEIGHT: |
| 3090 case GL_RENDERBUFFER_RED_SIZE: | 3062 case GL_RENDERBUFFER_RED_SIZE: |
| 3091 case GL_RENDERBUFFER_GREEN_SIZE: | 3063 case GL_RENDERBUFFER_GREEN_SIZE: |
| 3092 case GL_RENDERBUFFER_BLUE_SIZE: | 3064 case GL_RENDERBUFFER_BLUE_SIZE: |
| 3093 case GL_RENDERBUFFER_ALPHA_SIZE: | 3065 case GL_RENDERBUFFER_ALPHA_SIZE: |
| 3094 case GL_RENDERBUFFER_DEPTH_SIZE: | 3066 case GL_RENDERBUFFER_DEPTH_SIZE: |
| 3095 webContext()->getRenderbufferParameteriv(target, pname, &value); | 3067 webContext()->getRenderbufferParameteriv(target, pname, &value); |
| 3096 return WebGLAny(scriptState, value); | 3068 return WebGLAny(scriptState, value); |
| 3097 case GL_RENDERBUFFER_STENCIL_SIZE: | 3069 case GL_RENDERBUFFER_STENCIL_SIZE: |
| 3098 if (m_renderbufferBinding->emulatedStencilBuffer()) { | 3070 webContext()->getRenderbufferParameteriv(target, pname, &value); |
| 3099 webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBi
nding->emulatedStencilBuffer())); | |
| 3100 webContext()->getRenderbufferParameteriv(target, pname, &value); | |
| 3101 webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBi
nding.get())); | |
| 3102 } else { | |
| 3103 webContext()->getRenderbufferParameteriv(target, pname, &value); | |
| 3104 } | |
| 3105 return WebGLAny(scriptState, value); | 3071 return WebGLAny(scriptState, value); |
| 3106 case GL_RENDERBUFFER_INTERNAL_FORMAT: | 3072 case GL_RENDERBUFFER_INTERNAL_FORMAT: |
| 3107 return WebGLAny(scriptState, m_renderbufferBinding->internalFormat()); | 3073 return WebGLAny(scriptState, m_renderbufferBinding->internalFormat()); |
| 3108 default: | 3074 default: |
| 3109 synthesizeGLError(GL_INVALID_ENUM, "getRenderbufferParameter", "invalid
parameter name"); | 3075 synthesizeGLError(GL_INVALID_ENUM, "getRenderbufferParameter", "invalid
parameter name"); |
| 3110 return ScriptValue::createNull(scriptState); | 3076 return ScriptValue::createNull(scriptState); |
| 3111 } | 3077 } |
| 3112 } | 3078 } |
| 3113 | 3079 |
| 3114 ScriptValue WebGLRenderingContextBase::getShaderParameter(ScriptState* scriptSta
te, WebGLShader* shader, GLenum pname) | 3080 ScriptValue WebGLRenderingContextBase::getShaderParameter(ScriptState* scriptSta
te, WebGLShader* shader, GLenum pname) |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3850 ASSERT(!isWebGL2OrHigher()); // Make sure this is overridden in WebGL 2. | 3816 ASSERT(!isWebGL2OrHigher()); // Make sure this is overridden in WebGL 2. |
| 3851 switch (internalformat) { | 3817 switch (internalformat) { |
| 3852 case GL_DEPTH_COMPONENT16: | 3818 case GL_DEPTH_COMPONENT16: |
| 3853 case GL_RGBA4: | 3819 case GL_RGBA4: |
| 3854 case GL_RGB5_A1: | 3820 case GL_RGB5_A1: |
| 3855 case GL_RGB565: | 3821 case GL_RGB565: |
| 3856 case GL_STENCIL_INDEX8: | 3822 case GL_STENCIL_INDEX8: |
| 3857 webContext()->renderbufferStorage(target, internalformat, width, height)
; | 3823 webContext()->renderbufferStorage(target, internalformat, width, height)
; |
| 3858 m_renderbufferBinding->setInternalFormat(internalformat); | 3824 m_renderbufferBinding->setInternalFormat(internalformat); |
| 3859 m_renderbufferBinding->setSize(width, height); | 3825 m_renderbufferBinding->setSize(width, height); |
| 3860 m_renderbufferBinding->deleteEmulatedStencilBuffer(webContext()); | |
| 3861 break; | 3826 break; |
| 3862 case GL_SRGB8_ALPHA8_EXT: | 3827 case GL_SRGB8_ALPHA8_EXT: |
| 3863 if (!extensionEnabled(EXTsRGBName)) { | 3828 if (!extensionEnabled(EXTsRGBName)) { |
| 3864 synthesizeGLError(GL_INVALID_ENUM, functionName, "sRGB not enabled")
; | 3829 synthesizeGLError(GL_INVALID_ENUM, functionName, "sRGB not enabled")
; |
| 3865 break; | 3830 break; |
| 3866 } | 3831 } |
| 3867 webContext()->renderbufferStorage(target, internalformat, width, height)
; | 3832 webContext()->renderbufferStorage(target, internalformat, width, height)
; |
| 3868 m_renderbufferBinding->setInternalFormat(internalformat); | 3833 m_renderbufferBinding->setInternalFormat(internalformat); |
| 3869 m_renderbufferBinding->setSize(width, height); | 3834 m_renderbufferBinding->setSize(width, height); |
| 3870 m_renderbufferBinding->deleteEmulatedStencilBuffer(webContext()); | |
| 3871 break; | 3835 break; |
| 3872 case GL_DEPTH_STENCIL_OES: | 3836 case GL_DEPTH_STENCIL_OES: |
| 3873 if (isDepthStencilSupported()) { | 3837 ASSERT(isDepthStencilSupported()); |
| 3874 webContext()->renderbufferStorage(target, GL_DEPTH24_STENCIL8_OES, w
idth, height); | 3838 webContext()->renderbufferStorage(target, GL_DEPTH24_STENCIL8_OES, width
, height); |
| 3875 } else { | |
| 3876 WebGLRenderbuffer* emulatedStencilBuffer = ensureEmulatedStencilBuff
er(target, m_renderbufferBinding.get()); | |
| 3877 if (!emulatedStencilBuffer) { | |
| 3878 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory
"); | |
| 3879 break; | |
| 3880 } | |
| 3881 webContext()->renderbufferStorage(target, GL_DEPTH_COMPONENT16, widt
h, height); | |
| 3882 webContext()->bindRenderbuffer(target, objectOrZero(emulatedStencilB
uffer)); | |
| 3883 webContext()->renderbufferStorage(target, GL_STENCIL_INDEX8, width,
height); | |
| 3884 webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBi
nding.get())); | |
| 3885 emulatedStencilBuffer->setSize(width, height); | |
| 3886 emulatedStencilBuffer->setInternalFormat(GL_STENCIL_INDEX8); | |
| 3887 } | |
| 3888 m_renderbufferBinding->setSize(width, height); | 3839 m_renderbufferBinding->setSize(width, height); |
| 3889 m_renderbufferBinding->setInternalFormat(internalformat); | 3840 m_renderbufferBinding->setInternalFormat(internalformat); |
| 3890 break; | 3841 break; |
| 3891 default: | 3842 default: |
| 3892 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
"); | 3843 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
"); |
| 3893 break; | 3844 break; |
| 3894 } | 3845 } |
| 3895 } | 3846 } |
| 3896 | 3847 |
| 3897 void WebGLRenderingContextBase::renderbufferStorage(GLenum target, GLenum intern
alformat, GLsizei width, GLsizei height) | 3848 void WebGLRenderingContextBase::renderbufferStorage(GLenum target, GLenum intern
alformat, GLsizei width, GLsizei height) |
| (...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6844 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6795 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6845 } | 6796 } |
| 6846 | 6797 |
| 6847 void WebGLRenderingContextBase::restoreUnpackParameters() | 6798 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6848 { | 6799 { |
| 6849 if (m_unpackAlignment != 1) | 6800 if (m_unpackAlignment != 1) |
| 6850 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6801 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6851 } | 6802 } |
| 6852 | 6803 |
| 6853 } // namespace blink | 6804 } // namespace blink |
| OLD | NEW |