Chromium Code Reviews| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 #include "modules/webgl/OESTextureHalfFloatLinear.h" | 59 #include "modules/webgl/OESTextureHalfFloatLinear.h" | 
| 60 #include "modules/webgl/OESVertexArrayObject.h" | 60 #include "modules/webgl/OESVertexArrayObject.h" | 
| 61 #include "modules/webgl/WebGLActiveInfo.h" | 61 #include "modules/webgl/WebGLActiveInfo.h" | 
| 62 #include "modules/webgl/WebGLBuffer.h" | 62 #include "modules/webgl/WebGLBuffer.h" | 
| 63 #include "modules/webgl/WebGLCompressedTextureASTC.h" | 63 #include "modules/webgl/WebGLCompressedTextureASTC.h" | 
| 64 #include "modules/webgl/WebGLCompressedTextureATC.h" | 64 #include "modules/webgl/WebGLCompressedTextureATC.h" | 
| 65 #include "modules/webgl/WebGLCompressedTextureETC1.h" | 65 #include "modules/webgl/WebGLCompressedTextureETC1.h" | 
| 66 #include "modules/webgl/WebGLCompressedTexturePVRTC.h" | 66 #include "modules/webgl/WebGLCompressedTexturePVRTC.h" | 
| 67 #include "modules/webgl/WebGLCompressedTextureS3TC.h" | 67 #include "modules/webgl/WebGLCompressedTextureS3TC.h" | 
| 68 #include "modules/webgl/WebGLContextAttributeHelpers.h" | 68 #include "modules/webgl/WebGLContextAttributeHelpers.h" | 
| 69 #include "modules/webgl/WebGLContextAttributes.h" | |
| 70 #include "modules/webgl/WebGLContextEvent.h" | 69 #include "modules/webgl/WebGLContextEvent.h" | 
| 71 #include "modules/webgl/WebGLContextGroup.h" | 70 #include "modules/webgl/WebGLContextGroup.h" | 
| 72 #include "modules/webgl/WebGLDebugRendererInfo.h" | 71 #include "modules/webgl/WebGLDebugRendererInfo.h" | 
| 73 #include "modules/webgl/WebGLDebugShaders.h" | 72 #include "modules/webgl/WebGLDebugShaders.h" | 
| 74 #include "modules/webgl/WebGLDepthTexture.h" | 73 #include "modules/webgl/WebGLDepthTexture.h" | 
| 75 #include "modules/webgl/WebGLDrawBuffers.h" | 74 #include "modules/webgl/WebGLDrawBuffers.h" | 
| 76 #include "modules/webgl/WebGLFramebuffer.h" | 75 #include "modules/webgl/WebGLFramebuffer.h" | 
| 77 #include "modules/webgl/WebGLLoseContext.h" | 76 #include "modules/webgl/WebGLLoseContext.h" | 
| 78 #include "modules/webgl/WebGLProgram.h" | 77 #include "modules/webgl/WebGLProgram.h" | 
| 79 #include "modules/webgl/WebGLRenderbuffer.h" | 78 #include "modules/webgl/WebGLRenderbuffer.h" | 
| 80 #include "modules/webgl/WebGLShader.h" | 79 #include "modules/webgl/WebGLShader.h" | 
| 81 #include "modules/webgl/WebGLShaderPrecisionFormat.h" | 80 #include "modules/webgl/WebGLShaderPrecisionFormat.h" | 
| 82 #include "modules/webgl/WebGLTexture.h" | |
| 83 #include "modules/webgl/WebGLUniformLocation.h" | 81 #include "modules/webgl/WebGLUniformLocation.h" | 
| 84 #include "modules/webgl/WebGLVertexArrayObject.h" | 82 #include "modules/webgl/WebGLVertexArrayObject.h" | 
| 85 #include "modules/webgl/WebGLVertexArrayObjectOES.h" | 83 #include "modules/webgl/WebGLVertexArrayObjectOES.h" | 
| 86 #include "platform/CheckedInt.h" | 84 #include "platform/CheckedInt.h" | 
| 87 #include "platform/RuntimeEnabledFeatures.h" | 85 #include "platform/RuntimeEnabledFeatures.h" | 
| 86 #include "platform/ThreadSafeFunctional.h" | |
| 87 #include "platform/WaitableEvent.h" | |
| 88 #include "platform/geometry/IntSize.h" | 88 #include "platform/geometry/IntSize.h" | 
| 89 #include "platform/graphics/GraphicsContext.h" | 89 #include "platform/graphics/GraphicsContext.h" | 
| 90 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 90 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 
| 91 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h" | 91 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h" | 
| 92 #include "platform/graphics/gpu/DrawingBuffer.h" | |
| 93 #include "public/platform/Platform.h" | 92 #include "public/platform/Platform.h" | 
| 94 #include "public/platform/WebGraphicsContext3DProvider.h" | |
| 95 #include "public/platform/functional/WebFunction.h" | 93 #include "public/platform/functional/WebFunction.h" | 
| 96 #include "wtf/Functional.h" | 94 #include "wtf/Functional.h" | 
| 97 #include "wtf/PassOwnPtr.h" | 95 #include "wtf/PassOwnPtr.h" | 
| 98 #include "wtf/text/StringBuilder.h" | 96 #include "wtf/text/StringBuilder.h" | 
| 99 #include "wtf/text/StringUTF8Adaptor.h" | 97 #include "wtf/text/StringUTF8Adaptor.h" | 
| 100 #include "wtf/typed_arrays/ArrayBufferContents.h" | 98 #include "wtf/typed_arrays/ArrayBufferContents.h" | 
| 101 | 99 | 
| 102 #include <memory> | 100 #include <memory> | 
| 103 | 101 | 
| 104 namespace blink { | 102 namespace blink { | 
| 105 | 103 | 
| 106 namespace { | 104 namespace { | 
| 107 | 105 | 
| 108 const double secondsBetweenRestoreAttempts = 1.0; | 106 const double secondsBetweenRestoreAttempts = 1.0; | 
| 109 const int maxGLErrorsAllowedToConsole = 256; | 107 const int maxGLErrorsAllowedToConsole = 256; | 
| 110 const unsigned maxGLActiveContexts = 16; | 108 const unsigned maxGLActiveContexts = 16; | 
| 111 | 109 | 
| 112 using WebGLRenderingContextBaseSet = PersistentHeapHashSet<WeakMember<WebGLRende ringContextBase>>; | 110 using WebGLRenderingContextBaseSet = PersistentHeapHashSet<WeakMember<WebGLRende ringContextBase>>; | 
| 113 WebGLRenderingContextBaseSet& activeContexts() | 111 WebGLRenderingContextBaseSet& activeContexts() | 
| 114 { | 112 { | 
| 115 DEFINE_STATIC_LOCAL(WebGLRenderingContextBaseSet, activeContexts, ()); | 113 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<WebGLRenderingContextBaseSet> , activeContexts, new ThreadSpecific<WebGLRenderingContextBaseSet>()); | 
| 116 return activeContexts; | 114 if (!activeContexts.isSet()) | 
| 115 activeContexts->registerAsStaticReference(); | |
| 116 return *activeContexts; | |
| 117 } | 117 } | 
| 118 | 118 | 
| 119 using WebGLRenderingContextBaseMap = PersistentHeapHashMap<WeakMember<WebGLRende ringContextBase>, int>; | 119 using WebGLRenderingContextBaseMap = PersistentHeapHashMap<WeakMember<WebGLRende ringContextBase>, int>; | 
| 120 WebGLRenderingContextBaseMap& forciblyEvictedContexts() | 120 WebGLRenderingContextBaseMap& forciblyEvictedContexts() | 
| 121 { | 121 { | 
| 122 DEFINE_STATIC_LOCAL(WebGLRenderingContextBaseMap, forciblyEvictedContexts, ( )); | 122 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<WebGLRenderingContextBaseMap> , forciblyEvictedContexts, new ThreadSpecific<WebGLRenderingContextBaseMap>()); | 
| 123 return forciblyEvictedContexts; | 123 if (!forciblyEvictedContexts.isSet()) | 
| 124 forciblyEvictedContexts->registerAsStaticReference(); | |
| 125 return *forciblyEvictedContexts; | |
| 124 } | 126 } | 
| 125 | 127 | 
| 126 } // namespace | 128 } // namespace | 
| 127 | 129 | 
| 128 ScopedRGBEmulationColorMask::ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interf ace* contextGL, GLboolean* colorMask, DrawingBuffer* drawingBuffer) | 130 ScopedRGBEmulationColorMask::ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interf ace* contextGL, GLboolean* colorMask, DrawingBuffer* drawingBuffer) | 
| 129 : m_contextGL(contextGL) | 131 : m_contextGL(contextGL) | 
| 130 , m_requiresEmulation(drawingBuffer->requiresAlphaChannelToBePreserved()) | 132 , m_requiresEmulation(drawingBuffer->requiresAlphaChannelToBePreserved()) | 
| 131 { | 133 { | 
| 132 if (m_requiresEmulation) { | 134 if (m_requiresEmulation) { | 
| 133 memcpy(m_colorMask, colorMask, 4 * sizeof(GLboolean)); | 135 memcpy(m_colorMask, colorMask, 4 * sizeof(GLboolean)); | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 forciblyEvictedContexts().set(context, generation++); | 213 forciblyEvictedContexts().set(context, generation++); | 
| 212 } | 214 } | 
| 213 | 215 | 
| 214 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase* context) | 216 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase* context) | 
| 215 { | 217 { | 
| 216 forciblyEvictedContexts().remove(context); | 218 forciblyEvictedContexts().remove(context); | 
| 217 } | 219 } | 
| 218 | 220 | 
| 219 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co ntext) | 221 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co ntext) | 
| 220 { | 222 { | 
| 223 // If this function happens when the thread is terminating, then skip this f unction. | |
| 224 if (ThreadState::current()->isTerminating()) | |
| 225 return; | |
| 226 | |
| 
 
xidachen
2016/05/06 15:15:28
sof@: is it okay to call isTerminating() here? The
 
sof
2016/05/06 15:36:44
Because the !currentCount assert fails, or somethi
 
xidachen
2016/05/06 15:38:05
Yes, it is hitting the !currentCount, and I looked
 
sof
2016/05/06 15:45:15
thanks, I suggest we instead try to call releaseSt
 
xidachen
2016/05/06 15:59:35
That works! Thank you.
 
sof
2016/05/06 16:06:16
It would be preferable to land that ThreadState ch
 
 | |
| 221 // These two sets keep weak references to their contexts; | 227 // These two sets keep weak references to their contexts; | 
| 222 // verify that the GC already removed the |context| entries. | 228 // verify that the GC already removed the |context| entries. | 
| 223 ASSERT(!forciblyEvictedContexts().contains(context)); | 229 ASSERT(!forciblyEvictedContexts().contains(context)); | 
| 224 ASSERT(!activeContexts().contains(context)); | 230 ASSERT(!activeContexts().contains(context)); | 
| 225 | 231 | 
| 226 // Try to re-enable the oldest inactive contexts. | 232 // Try to re-enable the oldest inactive contexts. | 
| 227 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte xts().size()) { | 233 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte xts().size()) { | 
| 228 WebGLRenderingContextBase* evictedContext = oldestEvictedContext(); | 234 WebGLRenderingContextBase* evictedContext = oldestEvictedContext(); | 
| 229 if (!evictedContext->m_restoreAllowed) { | 235 if (!evictedContext->m_restoreAllowed) { | 
| 230 forciblyEvictedContexts().remove(evictedContext); | 236 forciblyEvictedContexts().remove(evictedContext); | 
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 513 formatWebGLStatusString("Sandboxed", info.sandboxed ? "yes" : "no", statusMe ssage); | 519 formatWebGLStatusString("Sandboxed", info.sandboxed ? "yes" : "no", statusMe ssage); | 
| 514 formatWebGLStatusString("Optimus", info.optimus ? "yes" : "no", statusMessag e); | 520 formatWebGLStatusString("Optimus", info.optimus ? "yes" : "no", statusMessag e); | 
| 515 formatWebGLStatusString("AMD switchable", info.amdSwitchable ? "yes" : "no", statusMessage); | 521 formatWebGLStatusString("AMD switchable", info.amdSwitchable ? "yes" : "no", statusMessage); | 
| 516 formatWebGLStatusString("Reset notification strategy", String::format("0x%04 x", info.resetNotificationStrategy).utf8().data(), statusMessage); | 522 formatWebGLStatusString("Reset notification strategy", String::format("0x%04 x", info.resetNotificationStrategy).utf8().data(), statusMessage); | 
| 517 formatWebGLStatusString("GPU process crash count", String::number(info.proce ssCrashCount).utf8().data(), statusMessage); | 523 formatWebGLStatusString("GPU process crash count", String::number(info.proce ssCrashCount).utf8().data(), statusMessage); | 
| 518 formatWebGLStatusString("ErrorMessage", info.errorMessage.utf8().data(), sta tusMessage); | 524 formatWebGLStatusString("ErrorMessage", info.errorMessage.utf8().data(), sta tusMessage); | 
| 519 statusMessage.append("."); | 525 statusMessage.append("."); | 
| 520 return statusMessage; | 526 return statusMessage; | 
| 521 } | 527 } | 
| 522 | 528 | 
| 523 static PassOwnPtr<WebGraphicsContext3DProvider> createWebGraphicsContext3DProvid erInternal(HTMLCanvasElement* canvas, ScriptState* scriptState, WebGLContextAttr ibutes attributes, unsigned webGLVersion) | 529 void WebGLRenderingContextBase::createWebGraphicsContext3DProviderOnMainThread(W ebGLRenderingContextBase::createWebGraphicsContext3DProviderUtils* createUtils, WaitableEvent* waitableEvent) | 
| 530 { | |
| 531 ASSERT(isMainThread()); | |
| 532 Platform::GraphicsInfo glInfo = createUtils->glInfo(); | |
| 533 OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current() ->createOffscreenGraphicsContext3DProvider( | |
| 534 createUtils->contextAttributes(), createUtils->scriptState()->getExecuti onContext()->url(), 0, &glInfo, Platform::DoNotBindToCurrentThread)); | |
| 535 createUtils->setContextProvider(provider.release()); | |
| 536 waitableEvent->signal(); | |
| 537 } | |
| 538 | |
| 539 PassOwnPtr<WebGraphicsContext3DProvider> WebGLRenderingContextBase::createWebGra phicsContext3DProviderInternal(HTMLCanvasElement* canvas, ScriptState* scriptSta te, WebGLContextAttributes attributes, unsigned webGLVersion) | |
| 524 { | 540 { | 
| 525 Platform::ContextAttributes contextAttributes = toPlatformContextAttributes( attributes, webGLVersion); | 541 Platform::ContextAttributes contextAttributes = toPlatformContextAttributes( attributes, webGLVersion); | 
| 526 Platform::GraphicsInfo glInfo; | 542 Platform::GraphicsInfo glInfo; | 
| 527 OwnPtr<WebGraphicsContext3DProvider> contextProvider; | 543 OwnPtr<WebGraphicsContext3DProvider> contextProvider; | 
| 528 if (canvas) { | 544 if (canvas) { | 
| 529 contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsC ontext3DProvider( | 545 contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsC ontext3DProvider( | 
| 530 contextAttributes, canvas->document().topDocument().url(), 0, &glInf o)); | 546 contextAttributes, canvas->document().topDocument().url(), 0, &glInf o, Platform::BindToCurrentThread)); | 
| 531 } else { | 547 } else { | 
| 532 contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsC ontext3DProvider( | 548 if (isMainThread()) { | 
| 533 contextAttributes, scriptState->getExecutionContext()->url(), 0, &gl Info)); | 549 contextProvider = adoptPtr(Platform::current()->createOffscreenGraph icsContext3DProvider( | 
| 550 contextAttributes, scriptState->getExecutionContext()->url(), 0, &glInfo, Platform::BindToCurrentThread)); | |
| 551 } else { | |
| 552 WaitableEvent waitableEvent; | |
| 553 WebTaskRunner* taskRunner = Platform::current()->mainThread()->getWe bTaskRunner(); | |
| 554 OwnPtr<WebGLRenderingContextBase::createWebGraphicsContext3DProvider Utils> createUtils = adoptPtr(new WebGLRenderingContextBase::createWebGraphicsCo ntext3DProviderUtils(contextAttributes, glInfo, scriptState)); | |
| 555 taskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&createWebGraph icsContext3DProviderOnMainThread, AllowCrossThreadAccess(createUtils.get()), All owCrossThreadAccess(&waitableEvent))); | |
| 556 waitableEvent.wait(); | |
| 557 contextProvider = createUtils->releaseContextProvider(); | |
| 558 if (!contextProvider->BindToCurrentThread()) | |
| 559 return nullptr; | |
| 560 } | |
| 534 } | 561 } | 
| 535 if (!contextProvider || shouldFailContextCreationForTesting) { | 562 if (!contextProvider || shouldFailContextCreationForTesting) { | 
| 536 shouldFailContextCreationForTesting = false; | 563 shouldFailContextCreationForTesting = false; | 
| 537 if (canvas) | 564 if (canvas) | 
| 538 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webg lcontextcreationerror, false, true, extractWebGLContextCreationError(glInfo))); | 565 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webg lcontextcreationerror, false, true, extractWebGLContextCreationError(glInfo))); | 
| 539 return nullptr; | 566 return nullptr; | 
| 540 } | 567 } | 
| 541 gpu::gles2::GLES2Interface* gl = contextProvider->contextGL(); | 568 gpu::gles2::GLES2Interface* gl = contextProvider->contextGL(); | 
| 542 if (!String(gl->GetString(GL_EXTENSIONS)).contains("GL_OES_packed_depth_sten cil")) { | 569 if (!String(gl->GetString(GL_EXTENSIONS)).contains("GL_OES_packed_depth_sten cil")) { | 
| 543 if (canvas) | 570 if (canvas) | 
| 544 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webg lcontextcreationerror, false, true, "OES_packed_depth_stencil support is require d.")); | 571 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webg lcontextcreationerror, false, true, "OES_packed_depth_stencil support is require d.")); | 
| 545 return nullptr; | 572 return nullptr; | 
| 546 } | 573 } | 
| 547 | |
| 548 return contextProvider.release(); | 574 return contextProvider.release(); | 
| 549 } | 575 } | 
| 550 | 576 | 
| 551 PassOwnPtr<WebGraphicsContext3DProvider> WebGLRenderingContextBase::createWebGra phicsContext3DProvider(HTMLCanvasElement* canvas, WebGLContextAttributes attribu tes, unsigned webGLVersion) | 577 PassOwnPtr<WebGraphicsContext3DProvider> WebGLRenderingContextBase::createWebGra phicsContext3DProvider(HTMLCanvasElement* canvas, WebGLContextAttributes attribu tes, unsigned webGLVersion) | 
| 552 { | 578 { | 
| 553 Document& document = canvas->document(); | 579 Document& document = canvas->document(); | 
| 554 LocalFrame* frame = document.frame(); | 580 LocalFrame* frame = document.frame(); | 
| 555 if (!frame) { | 581 if (!frame) { | 
| 556 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Web page was not allowed to create a WebGL cont ext.")); | 582 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Web page was not allowed to create a WebGL cont ext.")); | 
| 557 return nullptr; | 583 return nullptr; | 
| (...skipping 5403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5961 | 5987 | 
| 5962 // If the context was lost due to RealLostContext, we need to destroy the ol d DrawingBuffer before creating new DrawingBuffer to ensure resource budget enou gh. | 5988 // If the context was lost due to RealLostContext, we need to destroy the ol d DrawingBuffer before creating new DrawingBuffer to ensure resource budget enou gh. | 
| 5963 if (drawingBuffer()) { | 5989 if (drawingBuffer()) { | 
| 5964 m_drawingBuffer->beginDestruction(); | 5990 m_drawingBuffer->beginDestruction(); | 
| 5965 m_drawingBuffer.clear(); | 5991 m_drawingBuffer.clear(); | 
| 5966 } | 5992 } | 
| 5967 | 5993 | 
| 5968 Platform::ContextAttributes attributes = toPlatformContextAttributes(m_reque stedAttributes, version()); | 5994 Platform::ContextAttributes attributes = toPlatformContextAttributes(m_reque stedAttributes, version()); | 
| 5969 Platform::GraphicsInfo glInfo; | 5995 Platform::GraphicsInfo glInfo; | 
| 5970 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu rrent()->createOffscreenGraphicsContext3DProvider( | 5996 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu rrent()->createOffscreenGraphicsContext3DProvider( | 
| 5971 attributes, canvas()->document().topDocument().url(), 0, &glInfo)); | 5997 attributes, canvas()->document().topDocument().url(), 0, &glInfo, Platfo rm::BindToCurrentThread)); | 
| 5972 RefPtr<DrawingBuffer> buffer; | 5998 RefPtr<DrawingBuffer> buffer; | 
| 5973 if (contextProvider) { | 5999 if (contextProvider) { | 
| 5974 // Construct a new drawing buffer with the new GL context. | 6000 // Construct a new drawing buffer with the new GL context. | 
| 5975 buffer = createDrawingBuffer(contextProvider.release()); | 6001 buffer = createDrawingBuffer(contextProvider.release()); | 
| 5976 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. | 6002 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. | 
| 5977 } | 6003 } | 
| 5978 if (!buffer) { | 6004 if (!buffer) { | 
| 5979 if (m_contextLostMode == RealLostContext) { | 6005 if (m_contextLostMode == RealLostContext) { | 
| 5980 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, BLINK_FRO M_HERE); | 6006 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, BLINK_FRO M_HERE); | 
| 5981 } else { | 6007 } else { | 
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6306 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6332 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 
| 6307 } | 6333 } | 
| 6308 | 6334 | 
| 6309 void WebGLRenderingContextBase::restoreUnpackParameters() | 6335 void WebGLRenderingContextBase::restoreUnpackParameters() | 
| 6310 { | 6336 { | 
| 6311 if (m_unpackAlignment != 1) | 6337 if (m_unpackAlignment != 1) | 
| 6312 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6338 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 
| 6313 } | 6339 } | 
| 6314 | 6340 | 
| 6315 } // namespace blink | 6341 } // namespace blink | 
| OLD | NEW |