| OLD | NEW | 
|     1 // Copyright 2015 The Chromium Authors. All rights reserved. |     1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
|     2 // Use of this source code is governed by a BSD-style license that can be |     2 // Use of this source code is governed by a BSD-style license that can be | 
|     3 // found in the LICENSE file. |     3 // found in the LICENSE file. | 
|     4  |     4  | 
|     5 #include "modules/webgl/WebGL2RenderingContextBase.h" |     5 #include "modules/webgl/WebGL2RenderingContextBase.h" | 
|     6  |     6  | 
|     7 #include "bindings/modules/v8/WebGLAny.h" |     7 #include "bindings/modules/v8/WebGLAny.h" | 
|     8 #include "core/frame/ImageBitmap.h" |     8 #include "core/frame/ImageBitmap.h" | 
|     9 #include "core/html/HTMLCanvasElement.h" |     9 #include "core/html/HTMLCanvasElement.h" | 
|    10 #include "core/html/HTMLImageElement.h" |    10 #include "core/html/HTMLImageElement.h" | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   146     m_boundCopyWriteBuffer = nullptr; |   146     m_boundCopyWriteBuffer = nullptr; | 
|   147     m_boundPixelPackBuffer = nullptr; |   147     m_boundPixelPackBuffer = nullptr; | 
|   148     m_boundPixelUnpackBuffer = nullptr; |   148     m_boundPixelUnpackBuffer = nullptr; | 
|   149     m_boundTransformFeedbackBuffer = nullptr; |   149     m_boundTransformFeedbackBuffer = nullptr; | 
|   150     m_boundUniformBuffer = nullptr; |   150     m_boundUniformBuffer = nullptr; | 
|   151  |   151  | 
|   152     m_currentBooleanOcclusionQuery = nullptr; |   152     m_currentBooleanOcclusionQuery = nullptr; | 
|   153     m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; |   153     m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; | 
|   154  |   154  | 
|   155     GLint numCombinedTextureImageUnits = 0; |   155     GLint numCombinedTextureImageUnits = 0; | 
|   156     webContext()->getIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numCombinedT
      extureImageUnits); |   156     contextGL()->GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numCombinedTe
      xtureImageUnits); | 
|   157     m_samplerUnits.clear(); |   157     m_samplerUnits.clear(); | 
|   158     m_samplerUnits.resize(numCombinedTextureImageUnits); |   158     m_samplerUnits.resize(numCombinedTextureImageUnits); | 
|   159  |   159  | 
|   160     m_maxTransformFeedbackSeparateAttribs = 0; |   160     m_maxTransformFeedbackSeparateAttribs = 0; | 
|   161     webContext()->getIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &m_max
      TransformFeedbackSeparateAttribs); |   161     contextGL()->GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &m_maxT
      ransformFeedbackSeparateAttribs); | 
|   162     m_boundIndexedTransformFeedbackBuffers.clear(); |   162     m_boundIndexedTransformFeedbackBuffers.clear(); | 
|   163     m_boundIndexedTransformFeedbackBuffers.resize(m_maxTransformFeedbackSeparate
      Attribs); |   163     m_boundIndexedTransformFeedbackBuffers.resize(m_maxTransformFeedbackSeparate
      Attribs); | 
|   164  |   164  | 
|   165     GLint maxUniformBufferBindings = 0; |   165     GLint maxUniformBufferBindings = 0; | 
|   166     webContext()->getIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferB
      indings); |   166     contextGL()->GetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBi
      ndings); | 
|   167     m_boundIndexedUniformBuffers.clear(); |   167     m_boundIndexedUniformBuffers.clear(); | 
|   168     m_boundIndexedUniformBuffers.resize(maxUniformBufferBindings); |   168     m_boundIndexedUniformBuffers.resize(maxUniformBufferBindings); | 
|   169     m_maxBoundUniformBufferIndex = 0; |   169     m_maxBoundUniformBufferIndex = 0; | 
|   170  |   170  | 
|   171     m_packRowLength = 0; |   171     m_packRowLength = 0; | 
|   172     m_packSkipPixels = 0; |   172     m_packSkipPixels = 0; | 
|   173     m_packSkipRows = 0; |   173     m_packSkipRows = 0; | 
|   174     m_unpackRowLength = 0; |   174     m_unpackRowLength = 0; | 
|   175     m_unpackImageHeight = 0; |   175     m_unpackImageHeight = 0; | 
|   176     m_unpackSkipPixels = 0; |   176     m_unpackSkipPixels = 0; | 
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   585     case GL_UNPACK_SKIP_ROWS: |   585     case GL_UNPACK_SKIP_ROWS: | 
|   586         m_unpackSkipRows = param; |   586         m_unpackSkipRows = param; | 
|   587         break; |   587         break; | 
|   588     case GL_UNPACK_SKIP_IMAGES: |   588     case GL_UNPACK_SKIP_IMAGES: | 
|   589         m_unpackSkipImages = param; |   589         m_unpackSkipImages = param; | 
|   590         break; |   590         break; | 
|   591     default: |   591     default: | 
|   592         WebGLRenderingContextBase::pixelStorei(pname, param); |   592         WebGLRenderingContextBase::pixelStorei(pname, param); | 
|   593         return; |   593         return; | 
|   594     } |   594     } | 
|   595     webContext()->pixelStorei(pname, param); |   595     contextGL()->PixelStorei(pname, param); | 
|   596 } |   596 } | 
|   597  |   597  | 
|   598 void WebGL2RenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLs
      izei height, GLenum format, GLenum type, DOMArrayBufferView* pixels) |   598 void WebGL2RenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLs
      izei height, GLenum format, GLenum type, DOMArrayBufferView* pixels) | 
|   599 { |   599 { | 
|   600     if (isContextLost()) |   600     if (isContextLost()) | 
|   601         return; |   601         return; | 
|   602     if (m_boundPixelPackBuffer.get()) { |   602     if (m_boundPixelPackBuffer.get()) { | 
|   603         synthesizeGLError(GL_INVALID_OPERATION, "readPixels", "PIXEL_PACK buffer
       should not be bound"); |   603         synthesizeGLError(GL_INVALID_OPERATION, "readPixels", "PIXEL_PACK buffer
       should not be bound"); | 
|   604         return; |   604         return; | 
|   605     } |   605     } | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
|   635     long long size = buffer->getSize() - offset; |   635     long long size = buffer->getSize() - offset; | 
|   636     // If size is negative, or size is not large enough to store pixels, those c
      ases |   636     // If size is negative, or size is not large enough to store pixels, those c
      ases | 
|   637     // are handled by validateReadPixelsFuncParameters to generate INVALID_OPERA
      TION. |   637     // are handled by validateReadPixelsFuncParameters to generate INVALID_OPERA
      TION. | 
|   638     if (!validateReadPixelsFuncParameters(width, height, format, type, nullptr, 
      size)) |   638     if (!validateReadPixelsFuncParameters(width, height, format, type, nullptr, 
      size)) | 
|   639         return; |   639         return; | 
|   640  |   640  | 
|   641     clearIfComposited(); |   641     clearIfComposited(); | 
|   642  |   642  | 
|   643     { |   643     { | 
|   644         ScopedDrawingBufferBinder binder(drawingBuffer(), framebuffer); |   644         ScopedDrawingBufferBinder binder(drawingBuffer(), framebuffer); | 
|   645         webContext()->readPixels(x, y, width, height, format, type, reinterpret_
      cast<void*>(offset)); |   645         contextGL()->ReadPixels(x, y, width, height, format, type, reinterpret_c
      ast<void*>(offset)); | 
|   646     } |   646     } | 
|   647 } |   647 } | 
|   648  |   648  | 
|   649 void WebGL2RenderingContextBase::renderbufferStorageImpl( |   649 void WebGL2RenderingContextBase::renderbufferStorageImpl( | 
|   650     GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsize
      i height, |   650     GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsize
      i height, | 
|   651     const char* functionName) |   651     const char* functionName) | 
|   652 { |   652 { | 
|   653     switch (internalformat) { |   653     switch (internalformat) { | 
|   654     case GL_R8UI: |   654     case GL_R8UI: | 
|   655     case GL_R8I: |   655     case GL_R8I: | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
|   684     case GL_RGB5_A1: |   684     case GL_RGB5_A1: | 
|   685     case GL_RGBA4: |   685     case GL_RGBA4: | 
|   686     case GL_RGB10_A2: |   686     case GL_RGB10_A2: | 
|   687     case GL_DEPTH_COMPONENT16: |   687     case GL_DEPTH_COMPONENT16: | 
|   688     case GL_DEPTH_COMPONENT24: |   688     case GL_DEPTH_COMPONENT24: | 
|   689     case GL_DEPTH_COMPONENT32F: |   689     case GL_DEPTH_COMPONENT32F: | 
|   690     case GL_DEPTH24_STENCIL8: |   690     case GL_DEPTH24_STENCIL8: | 
|   691     case GL_DEPTH32F_STENCIL8: |   691     case GL_DEPTH32F_STENCIL8: | 
|   692     case GL_STENCIL_INDEX8: |   692     case GL_STENCIL_INDEX8: | 
|   693         if (!samples) { |   693         if (!samples) { | 
|   694             webContext()->renderbufferStorage(target, internalformat, width, hei
      ght); |   694             contextGL()->RenderbufferStorage(target, internalformat, width, heig
      ht); | 
|   695         } else { |   695         } else { | 
|   696             GLint maxNumberOfSamples = 0; |   696             GLint maxNumberOfSamples = 0; | 
|   697             webContext()->getInternalformativ(target, internalformat, GL_SAMPLES
      , 1, &maxNumberOfSamples); |   697             webContext()->getInternalformativ(target, internalformat, GL_SAMPLES
      , 1, &maxNumberOfSamples); | 
|   698             if (samples > maxNumberOfSamples) { |   698             if (samples > maxNumberOfSamples) { | 
|   699                 synthesizeGLError(GL_INVALID_OPERATION, functionName, "samples o
      ut of range"); |   699                 synthesizeGLError(GL_INVALID_OPERATION, functionName, "samples o
      ut of range"); | 
|   700                 return; |   700                 return; | 
|   701             } |   701             } | 
|   702             contextGL()->RenderbufferStorageMultisampleCHROMIUM( |   702             contextGL()->RenderbufferStorageMultisampleCHROMIUM( | 
|   703                 target, samples, internalformat, width, height); |   703                 target, samples, internalformat, width, height); | 
|   704         } |   704         } | 
|   705         break; |   705         break; | 
|   706     case GL_DEPTH_STENCIL: |   706     case GL_DEPTH_STENCIL: | 
|   707         // To be WebGL 1 backward compatible. |   707         // To be WebGL 1 backward compatible. | 
|   708         if (samples > 0) { |   708         if (samples > 0) { | 
|   709             synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalfo
      rmat"); |   709             synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalfo
      rmat"); | 
|   710             return; |   710             return; | 
|   711         } |   711         } | 
|   712         webContext()->renderbufferStorage(target, GL_DEPTH24_STENCIL8, width, he
      ight); |   712         contextGL()->RenderbufferStorage(target, GL_DEPTH24_STENCIL8, width, hei
      ght); | 
|   713         break; |   713         break; | 
|   714     case GL_R16F: |   714     case GL_R16F: | 
|   715     case GL_RG16F: |   715     case GL_RG16F: | 
|   716     case GL_RGBA16F: |   716     case GL_RGBA16F: | 
|   717     case GL_R32F: |   717     case GL_R32F: | 
|   718     case GL_RG32F: |   718     case GL_RG32F: | 
|   719     case GL_RGBA32F: |   719     case GL_RGBA32F: | 
|   720     case GL_R11F_G11F_B10F: |   720     case GL_R11F_G11F_B10F: | 
|   721         if (!extensionEnabled(EXTColorBufferFloatName)) { |   721         if (!extensionEnabled(EXTColorBufferFloatName)) { | 
|   722             synthesizeGLError(GL_INVALID_ENUM, functionName, "EXT_color_buffer_f
      loat not enabled"); |   722             synthesizeGLError(GL_INVALID_ENUM, functionName, "EXT_color_buffer_f
      loat not enabled"); | 
|   723             return; |   723             return; | 
|   724         } |   724         } | 
|   725         if (samples) { |   725         if (samples) { | 
|   726             synthesizeGLError(GL_INVALID_VALUE, functionName, "multisampled floa
      t buffers not supported"); |   726             synthesizeGLError(GL_INVALID_VALUE, functionName, "multisampled floa
      t buffers not supported"); | 
|   727             return; |   727             return; | 
|   728         } |   728         } | 
|   729         webContext()->renderbufferStorage(target, internalformat, width, height)
      ; |   729         contextGL()->RenderbufferStorage(target, internalformat, width, height); | 
|   730         break; |   730         break; | 
|   731     default: |   731     default: | 
|   732         synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
      "); |   732         synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
      "); | 
|   733         return; |   733         return; | 
|   734     } |   734     } | 
|   735     m_renderbufferBinding->setInternalFormat(internalformat); |   735     m_renderbufferBinding->setInternalFormat(internalformat); | 
|   736     m_renderbufferBinding->setSize(width, height); |   736     m_renderbufferBinding->setSize(width, height); | 
|   737 } |   737 } | 
|   738  |   738  | 
|   739 void WebGL2RenderingContextBase::renderbufferStorageMultisample(GLenum target, G
      Lsizei samples, GLenum internalformat, GLsizei width, GLsizei height) |   739 void WebGL2RenderingContextBase::renderbufferStorageMultisample(GLenum target, G
      Lsizei samples, GLenum internalformat, GLsizei width, GLsizei height) | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
|   757     } |   757     } | 
|   758     renderbufferStorageImpl(target, samples, internalformat, width, height, func
      tionName); |   758     renderbufferStorageImpl(target, samples, internalformat, width, height, func
      tionName); | 
|   759     applyStencilTest(); |   759     applyStencilTest(); | 
|   760 } |   760 } | 
|   761  |   761  | 
|   762 void WebGL2RenderingContextBase::resetUnpackParameters() |   762 void WebGL2RenderingContextBase::resetUnpackParameters() | 
|   763 { |   763 { | 
|   764     WebGLRenderingContextBase::resetUnpackParameters(); |   764     WebGLRenderingContextBase::resetUnpackParameters(); | 
|   765  |   765  | 
|   766     if (!m_unpackRowLength) |   766     if (!m_unpackRowLength) | 
|   767         webContext()->pixelStorei(GL_UNPACK_ROW_LENGTH, 0); |   767         contextGL()->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); | 
|   768     if (!m_unpackImageHeight) |   768     if (!m_unpackImageHeight) | 
|   769         webContext()->pixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); |   769         contextGL()->PixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); | 
|   770     if (!m_unpackSkipPixels) |   770     if (!m_unpackSkipPixels) | 
|   771         webContext()->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0); |   771         contextGL()->PixelStorei(GL_UNPACK_SKIP_PIXELS, 0); | 
|   772     if (!m_unpackSkipRows) |   772     if (!m_unpackSkipRows) | 
|   773         webContext()->pixelStorei(GL_UNPACK_SKIP_ROWS, 0); |   773         contextGL()->PixelStorei(GL_UNPACK_SKIP_ROWS, 0); | 
|   774     if (!m_unpackSkipImages) |   774     if (!m_unpackSkipImages) | 
|   775         webContext()->pixelStorei(GL_UNPACK_SKIP_IMAGES, 0); |   775         contextGL()->PixelStorei(GL_UNPACK_SKIP_IMAGES, 0); | 
|   776 } |   776 } | 
|   777  |   777  | 
|   778 void WebGL2RenderingContextBase::restoreUnpackParameters() |   778 void WebGL2RenderingContextBase::restoreUnpackParameters() | 
|   779 { |   779 { | 
|   780     WebGLRenderingContextBase::restoreUnpackParameters(); |   780     WebGLRenderingContextBase::restoreUnpackParameters(); | 
|   781  |   781  | 
|   782     if (!m_unpackRowLength) |   782     if (!m_unpackRowLength) | 
|   783         webContext()->pixelStorei(GL_UNPACK_ROW_LENGTH, m_unpackRowLength); |   783         contextGL()->PixelStorei(GL_UNPACK_ROW_LENGTH, m_unpackRowLength); | 
|   784     if (!m_unpackImageHeight) |   784     if (!m_unpackImageHeight) | 
|   785         webContext()->pixelStorei(GL_UNPACK_IMAGE_HEIGHT, m_unpackImageHeight); |   785         contextGL()->PixelStorei(GL_UNPACK_IMAGE_HEIGHT, m_unpackImageHeight); | 
|   786     if (!m_unpackSkipPixels) |   786     if (!m_unpackSkipPixels) | 
|   787         webContext()->pixelStorei(GL_UNPACK_SKIP_PIXELS, m_unpackSkipPixels); |   787         contextGL()->PixelStorei(GL_UNPACK_SKIP_PIXELS, m_unpackSkipPixels); | 
|   788     if (!m_unpackSkipRows) |   788     if (!m_unpackSkipRows) | 
|   789         webContext()->pixelStorei(GL_UNPACK_SKIP_ROWS, m_unpackSkipRows); |   789         contextGL()->PixelStorei(GL_UNPACK_SKIP_ROWS, m_unpackSkipRows); | 
|   790     if (!m_unpackSkipImages) |   790     if (!m_unpackSkipImages) | 
|   791         webContext()->pixelStorei(GL_UNPACK_SKIP_IMAGES, m_unpackSkipImages); |   791         contextGL()->PixelStorei(GL_UNPACK_SKIP_IMAGES, m_unpackSkipImages); | 
|   792 } |   792 } | 
|   793  |   793  | 
|   794 /* Texture objects */ |   794 /* Texture objects */ | 
|   795 bool WebGL2RenderingContextBase::validateTexStorage(const char* functionName, GL
      enum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei heigh
      t, GLsizei depth, TexStorageType functionType) |   795 bool WebGL2RenderingContextBase::validateTexStorage(const char* functionName, GL
      enum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei heigh
      t, GLsizei depth, TexStorageType functionType) | 
|   796 { |   796 { | 
|   797     if (functionType == TexStorageType2D) { |   797     if (functionType == TexStorageType2D) { | 
|   798         if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP) { |   798         if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP) { | 
|   799             synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 2D target"
      ); |   799             synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 2D target"
      ); | 
|   800             return false; |   800             return false; | 
|   801         } |   801         } | 
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1699     addSharedObject(o); |  1699     addSharedObject(o); | 
|  1700     return o; |  1700     return o; | 
|  1701 } |  1701 } | 
|  1702  |  1702  | 
|  1703 void WebGL2RenderingContextBase::deleteQuery(WebGLQuery* query) |  1703 void WebGL2RenderingContextBase::deleteQuery(WebGLQuery* query) | 
|  1704 { |  1704 { | 
|  1705     if (isContextLost() || !query) |  1705     if (isContextLost() || !query) | 
|  1706         return; |  1706         return; | 
|  1707  |  1707  | 
|  1708     if (m_currentBooleanOcclusionQuery == query) { |  1708     if (m_currentBooleanOcclusionQuery == query) { | 
|  1709         webContext()->endQueryEXT(m_currentBooleanOcclusionQuery->getTarget()); |  1709         contextGL()->EndQueryEXT(m_currentBooleanOcclusionQuery->getTarget()); | 
|  1710         m_currentBooleanOcclusionQuery = nullptr; |  1710         m_currentBooleanOcclusionQuery = nullptr; | 
|  1711     } |  1711     } | 
|  1712  |  1712  | 
|  1713     if (m_currentTransformFeedbackPrimitivesWrittenQuery == query) { |  1713     if (m_currentTransformFeedbackPrimitivesWrittenQuery == query) { | 
|  1714         webContext()->endQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); |  1714         contextGL()->EndQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); | 
|  1715         m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; |  1715         m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; | 
|  1716     } |  1716     } | 
|  1717  |  1717  | 
|  1718     deleteObject(query); |  1718     deleteObject(query); | 
|  1719 } |  1719 } | 
|  1720  |  1720  | 
|  1721 GLboolean WebGL2RenderingContextBase::isQuery(WebGLQuery* query) |  1721 GLboolean WebGL2RenderingContextBase::isQuery(WebGLQuery* query) | 
|  1722 { |  1722 { | 
|  1723     if (isContextLost() || !query) |  1723     if (isContextLost() || !query) | 
|  1724         return 0; |  1724         return 0; | 
|  1725  |  1725  | 
|  1726     return webContext()->isQueryEXT(query->object()); |  1726     return contextGL()->IsQueryEXT(query->object()); | 
|  1727 } |  1727 } | 
|  1728  |  1728  | 
|  1729 void WebGL2RenderingContextBase::beginQuery(GLenum target, WebGLQuery* query) |  1729 void WebGL2RenderingContextBase::beginQuery(GLenum target, WebGLQuery* query) | 
|  1730 { |  1730 { | 
|  1731     bool deleted; |  1731     bool deleted; | 
|  1732     if (!query) { |  1732     if (!query) { | 
|  1733         synthesizeGLError(GL_INVALID_OPERATION, "beginQuery", "query object is n
      ull"); |  1733         synthesizeGLError(GL_INVALID_OPERATION, "beginQuery", "query object is n
      ull"); | 
|  1734         return; |  1734         return; | 
|  1735     } |  1735     } | 
|  1736  |  1736  | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|  1767         } |  1767         } | 
|  1768         break; |  1768         break; | 
|  1769     default: |  1769     default: | 
|  1770         synthesizeGLError(GL_INVALID_ENUM, "beginQuery", "invalid target"); |  1770         synthesizeGLError(GL_INVALID_ENUM, "beginQuery", "invalid target"); | 
|  1771         return; |  1771         return; | 
|  1772     } |  1772     } | 
|  1773  |  1773  | 
|  1774     if (!query->getTarget()) |  1774     if (!query->getTarget()) | 
|  1775         query->setTarget(target); |  1775         query->setTarget(target); | 
|  1776  |  1776  | 
|  1777     webContext()->beginQueryEXT(target, query->object()); |  1777     contextGL()->BeginQueryEXT(target, query->object()); | 
|  1778 } |  1778 } | 
|  1779  |  1779  | 
|  1780 void WebGL2RenderingContextBase::endQuery(GLenum target) |  1780 void WebGL2RenderingContextBase::endQuery(GLenum target) | 
|  1781 { |  1781 { | 
|  1782     if (isContextLost()) |  1782     if (isContextLost()) | 
|  1783         return; |  1783         return; | 
|  1784  |  1784  | 
|  1785     switch (target) { |  1785     switch (target) { | 
|  1786     case GL_ANY_SAMPLES_PASSED: |  1786     case GL_ANY_SAMPLES_PASSED: | 
|  1787     case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: |  1787     case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
|  1804                 synthesizeGLError(GL_INVALID_OPERATION, "endQuery", "target quer
      y is not active"); |  1804                 synthesizeGLError(GL_INVALID_OPERATION, "endQuery", "target quer
      y is not active"); | 
|  1805                 return; |  1805                 return; | 
|  1806             } |  1806             } | 
|  1807         } |  1807         } | 
|  1808         break; |  1808         break; | 
|  1809     default: |  1809     default: | 
|  1810         synthesizeGLError(GL_INVALID_ENUM, "endQuery", "invalid target"); |  1810         synthesizeGLError(GL_INVALID_ENUM, "endQuery", "invalid target"); | 
|  1811         return; |  1811         return; | 
|  1812     } |  1812     } | 
|  1813  |  1813  | 
|  1814     webContext()->endQueryEXT(target); |  1814     contextGL()->EndQueryEXT(target); | 
|  1815 } |  1815 } | 
|  1816  |  1816  | 
|  1817 WebGLQuery* WebGL2RenderingContextBase::getQuery(GLenum target, GLenum pname) |  1817 WebGLQuery* WebGL2RenderingContextBase::getQuery(GLenum target, GLenum pname) | 
|  1818 { |  1818 { | 
|  1819     if (isContextLost()) |  1819     if (isContextLost()) | 
|  1820         return nullptr; |  1820         return nullptr; | 
|  1821  |  1821  | 
|  1822     if (pname != GL_CURRENT_QUERY) { |  1822     if (pname != GL_CURRENT_QUERY) { | 
|  1823         synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid parameter name")
      ; |  1823         synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid parameter name")
      ; | 
|  1824         return nullptr; |  1824         return nullptr; | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1859         return ScriptValue::createNull(scriptState); |  1859         return ScriptValue::createNull(scriptState); | 
|  1860     } |  1860     } | 
|  1861     if (query == m_currentBooleanOcclusionQuery || query == m_currentTransformFe
      edbackPrimitivesWrittenQuery) { |  1861     if (query == m_currentBooleanOcclusionQuery || query == m_currentTransformFe
      edbackPrimitivesWrittenQuery) { | 
|  1862         synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", "query is c
      urrently active"); |  1862         synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", "query is c
      urrently active"); | 
|  1863         return ScriptValue::createNull(scriptState); |  1863         return ScriptValue::createNull(scriptState); | 
|  1864     } |  1864     } | 
|  1865  |  1865  | 
|  1866     switch (pname) { |  1866     switch (pname) { | 
|  1867     case GL_QUERY_RESULT: |  1867     case GL_QUERY_RESULT: | 
|  1868         { |  1868         { | 
|  1869             query->updateCachedResult(webContext()); |  1869             query->updateCachedResult(contextGL()); | 
|  1870             return WebGLAny(scriptState, query->getQueryResult()); |  1870             return WebGLAny(scriptState, query->getQueryResult()); | 
|  1871         } |  1871         } | 
|  1872     case GL_QUERY_RESULT_AVAILABLE: |  1872     case GL_QUERY_RESULT_AVAILABLE: | 
|  1873         { |  1873         { | 
|  1874             query->updateCachedResult(webContext()); |  1874             query->updateCachedResult(contextGL()); | 
|  1875             return WebGLAny(scriptState, query->isQueryResultAvailable()); |  1875             return WebGLAny(scriptState, query->isQueryResultAvailable()); | 
|  1876         } |  1876         } | 
|  1877     default: |  1877     default: | 
|  1878         synthesizeGLError(GL_INVALID_ENUM, "getQueryParameter", "invalid paramet
      er name"); |  1878         synthesizeGLError(GL_INVALID_ENUM, "getQueryParameter", "invalid paramet
      er name"); | 
|  1879         return ScriptValue::createNull(scriptState); |  1879         return ScriptValue::createNull(scriptState); | 
|  1880     } |  1880     } | 
|  1881 } |  1881 } | 
|  1882  |  1882  | 
|  1883 WebGLSampler* WebGL2RenderingContextBase::createSampler() |  1883 WebGLSampler* WebGL2RenderingContextBase::createSampler() | 
|  1884 { |  1884 { | 
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2271 WebGLActiveInfo* WebGL2RenderingContextBase::getTransformFeedbackVarying(WebGLPr
      ogram* program, GLuint index) |  2271 WebGLActiveInfo* WebGL2RenderingContextBase::getTransformFeedbackVarying(WebGLPr
      ogram* program, GLuint index) | 
|  2272 { |  2272 { | 
|  2273     if (isContextLost() || !validateWebGLObject("getTransformFeedbackVarying", p
      rogram)) |  2273     if (isContextLost() || !validateWebGLObject("getTransformFeedbackVarying", p
      rogram)) | 
|  2274         return nullptr; |  2274         return nullptr; | 
|  2275  |  2275  | 
|  2276     if (!program->linkStatus()) { |  2276     if (!program->linkStatus()) { | 
|  2277         synthesizeGLError(GL_INVALID_OPERATION, "getTransformFeedbackVarying", "
      program not linked"); |  2277         synthesizeGLError(GL_INVALID_OPERATION, "getTransformFeedbackVarying", "
      program not linked"); | 
|  2278         return nullptr; |  2278         return nullptr; | 
|  2279     } |  2279     } | 
|  2280     GLint maxIndex = 0; |  2280     GLint maxIndex = 0; | 
|  2281     webContext()->getProgramiv(objectOrZero(program), GL_TRANSFORM_FEEDBACK_VARY
      INGS, &maxIndex); |  2281     contextGL()->GetProgramiv(objectOrZero(program), GL_TRANSFORM_FEEDBACK_VARYI
      NGS, &maxIndex); | 
|  2282     if (index >= static_cast<GLuint>(maxIndex)) { |  2282     if (index >= static_cast<GLuint>(maxIndex)) { | 
|  2283         synthesizeGLError(GL_INVALID_VALUE, "getTransformFeedbackVarying", "inva
      lid index"); |  2283         synthesizeGLError(GL_INVALID_VALUE, "getTransformFeedbackVarying", "inva
      lid index"); | 
|  2284         return nullptr; |  2284         return nullptr; | 
|  2285     } |  2285     } | 
|  2286  |  2286  | 
|  2287     GLint maxNameLength = -1; |  2287     GLint maxNameLength = -1; | 
|  2288     webContext()->getProgramiv(objectOrZero(program), GL_TRANSFORM_FEEDBACK_VARY
      ING_MAX_LENGTH, &maxNameLength); |  2288     contextGL()->GetProgramiv(objectOrZero(program), GL_TRANSFORM_FEEDBACK_VARYI
      NG_MAX_LENGTH, &maxNameLength); | 
|  2289     if (maxNameLength <= 0) { |  2289     if (maxNameLength <= 0) { | 
|  2290         return nullptr; |  2290         return nullptr; | 
|  2291     } |  2291     } | 
|  2292     OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); |  2292     OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); | 
|  2293     GLsizei length = 0; |  2293     GLsizei length = 0; | 
|  2294     GLsizei size = 0; |  2294     GLsizei size = 0; | 
|  2295     GLenum type = 0; |  2295     GLenum type = 0; | 
|  2296     webContext()->getTransformFeedbackVarying(objectOrZero(program), index, maxN
      ameLength, &length, &size, &type, name.get()); |  2296     webContext()->getTransformFeedbackVarying(objectOrZero(program), index, maxN
      ameLength, &length, &size, &type, name.get()); | 
|  2297  |  2297  | 
|  2298     if (length == 0 || size == 0 || type == 0) { |  2298     if (length == 0 || size == 0 || type == 0) { | 
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2440             synthesizeGLError(GL_INVALID_VALUE, "getIndexedParameter", "index ou
      t of range"); |  2440             synthesizeGLError(GL_INVALID_VALUE, "getIndexedParameter", "index ou
      t of range"); | 
|  2441             return ScriptValue::createNull(scriptState); |  2441             return ScriptValue::createNull(scriptState); | 
|  2442         } |  2442         } | 
|  2443         return WebGLAny(scriptState, m_boundIndexedUniformBuffers[index].get()); |  2443         return WebGLAny(scriptState, m_boundIndexedUniformBuffers[index].get()); | 
|  2444     case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: |  2444     case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: | 
|  2445     case GL_TRANSFORM_FEEDBACK_BUFFER_START: |  2445     case GL_TRANSFORM_FEEDBACK_BUFFER_START: | 
|  2446     case GL_UNIFORM_BUFFER_SIZE: |  2446     case GL_UNIFORM_BUFFER_SIZE: | 
|  2447     case GL_UNIFORM_BUFFER_START: |  2447     case GL_UNIFORM_BUFFER_START: | 
|  2448         { |  2448         { | 
|  2449             GLint64 value = -1; |  2449             GLint64 value = -1; | 
|  2450             webContext()->getInteger64i_v(target, index, &value); |  2450             contextGL()->GetInteger64i_v(target, index, &value); | 
|  2451             return WebGLAny(scriptState, value); |  2451             return WebGLAny(scriptState, value); | 
|  2452         } |  2452         } | 
|  2453     default: |  2453     default: | 
|  2454         synthesizeGLError(GL_INVALID_ENUM, "getIndexedParameter", "invalid param
      eter name"); |  2454         synthesizeGLError(GL_INVALID_ENUM, "getIndexedParameter", "invalid param
      eter name"); | 
|  2455         return ScriptValue::createNull(scriptState); |  2455         return ScriptValue::createNull(scriptState); | 
|  2456     } |  2456     } | 
|  2457 } |  2457 } | 
|  2458  |  2458  | 
|  2459 Vector<GLuint> WebGL2RenderingContextBase::getUniformIndices(WebGLProgram* progr
      am, const Vector<String>& uniformNames) |  2459 Vector<GLuint> WebGL2RenderingContextBase::getUniformIndices(WebGLProgram* progr
      am, const Vector<String>& uniformNames) | 
|  2460 { |  2460 { | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2502         break; |  2502         break; | 
|  2503     case GL_UNIFORM_IS_ROW_MAJOR: |  2503     case GL_UNIFORM_IS_ROW_MAJOR: | 
|  2504         returnType = BoolType; |  2504         returnType = BoolType; | 
|  2505         break; |  2505         break; | 
|  2506     default: |  2506     default: | 
|  2507         synthesizeGLError(GL_INVALID_ENUM, "getActiveUniforms", "invalid paramet
      er name"); |  2507         synthesizeGLError(GL_INVALID_ENUM, "getActiveUniforms", "invalid paramet
      er name"); | 
|  2508         return ScriptValue::createNull(scriptState); |  2508         return ScriptValue::createNull(scriptState); | 
|  2509     } |  2509     } | 
|  2510  |  2510  | 
|  2511     GLint activeUniforms = -1; |  2511     GLint activeUniforms = -1; | 
|  2512     webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORMS, &activ
      eUniforms); |  2512     contextGL()->GetProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORMS, &active
      Uniforms); | 
|  2513  |  2513  | 
|  2514     GLuint activeUniformsUnsigned = activeUniforms; |  2514     GLuint activeUniformsUnsigned = activeUniforms; | 
|  2515     size_t size = uniformIndices.size(); |  2515     size_t size = uniformIndices.size(); | 
|  2516     for (size_t i = 0; i < size; ++i) { |  2516     for (size_t i = 0; i < size; ++i) { | 
|  2517         if (uniformIndices[i] >= activeUniformsUnsigned) { |  2517         if (uniformIndices[i] >= activeUniformsUnsigned) { | 
|  2518             synthesizeGLError(GL_INVALID_VALUE, "getActiveUniforms", "uniform in
      dex greater than ACTIVE_UNIFORMS"); |  2518             synthesizeGLError(GL_INVALID_VALUE, "getActiveUniforms", "uniform in
      dex greater than ACTIVE_UNIFORMS"); | 
|  2519             return ScriptValue::createNull(scriptState); |  2519             return ScriptValue::createNull(scriptState); | 
|  2520         } |  2520         } | 
|  2521     } |  2521     } | 
|  2522  |  2522  | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2565 } |  2565 } | 
|  2566  |  2566  | 
|  2567 bool WebGL2RenderingContextBase::validateUniformBlockIndex(const char* functionN
      ame, WebGLProgram* program, GLuint blockIndex) |  2567 bool WebGL2RenderingContextBase::validateUniformBlockIndex(const char* functionN
      ame, WebGLProgram* program, GLuint blockIndex) | 
|  2568 { |  2568 { | 
|  2569     ASSERT(program); |  2569     ASSERT(program); | 
|  2570     if (!program->linkStatus()) { |  2570     if (!program->linkStatus()) { | 
|  2571         synthesizeGLError(GL_INVALID_OPERATION, functionName, "program not linke
      d"); |  2571         synthesizeGLError(GL_INVALID_OPERATION, functionName, "program not linke
      d"); | 
|  2572         return false; |  2572         return false; | 
|  2573     } |  2573     } | 
|  2574     GLint activeUniformBlocks = 0; |  2574     GLint activeUniformBlocks = 0; | 
|  2575     webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCKS, 
      &activeUniformBlocks); |  2575     contextGL()->GetProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCKS, &
      activeUniformBlocks); | 
|  2576     if (blockIndex >= static_cast<GLuint>(activeUniformBlocks)) { |  2576     if (blockIndex >= static_cast<GLuint>(activeUniformBlocks)) { | 
|  2577         synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid uniform block
       index"); |  2577         synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid uniform block
       index"); | 
|  2578         return false; |  2578         return false; | 
|  2579     } |  2579     } | 
|  2580     return true; |  2580     return true; | 
|  2581 } |  2581 } | 
|  2582  |  2582  | 
|  2583 ScriptValue WebGL2RenderingContextBase::getActiveUniformBlockParameter(ScriptSta
      te* scriptState, WebGLProgram* program, GLuint uniformBlockIndex, GLenum pname) |  2583 ScriptValue WebGL2RenderingContextBase::getActiveUniformBlockParameter(ScriptSta
      te* scriptState, WebGLProgram* program, GLuint uniformBlockIndex, GLenum pname) | 
|  2584 { |  2584 { | 
|  2585     if (isContextLost() || !validateWebGLObject("getActiveUniformBlockParameter"
      , program)) |  2585     if (isContextLost() || !validateWebGLObject("getActiveUniformBlockParameter"
      , program)) | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2621  |  2621  | 
|  2622 String WebGL2RenderingContextBase::getActiveUniformBlockName(WebGLProgram* progr
      am, GLuint uniformBlockIndex) |  2622 String WebGL2RenderingContextBase::getActiveUniformBlockName(WebGLProgram* progr
      am, GLuint uniformBlockIndex) | 
|  2623 { |  2623 { | 
|  2624     if (isContextLost() || !validateWebGLObject("getActiveUniformBlockName", pro
      gram)) |  2624     if (isContextLost() || !validateWebGLObject("getActiveUniformBlockName", pro
      gram)) | 
|  2625         return String(); |  2625         return String(); | 
|  2626  |  2626  | 
|  2627     if (!validateUniformBlockIndex("getActiveUniformBlockName", program, uniform
      BlockIndex)) |  2627     if (!validateUniformBlockIndex("getActiveUniformBlockName", program, uniform
      BlockIndex)) | 
|  2628         return String(); |  2628         return String(); | 
|  2629  |  2629  | 
|  2630     GLint maxNameLength = -1; |  2630     GLint maxNameLength = -1; | 
|  2631     webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCK_MA
      X_NAME_LENGTH, &maxNameLength); |  2631     contextGL()->GetProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORM_BLOCK_MAX
      _NAME_LENGTH, &maxNameLength); | 
|  2632     if (maxNameLength <= 0) { |  2632     if (maxNameLength <= 0) { | 
|  2633         // This state indicates that there are no active uniform blocks |  2633         // This state indicates that there are no active uniform blocks | 
|  2634         synthesizeGLError(GL_INVALID_VALUE, "getActiveUniformBlockName", "invali
      d uniform block index"); |  2634         synthesizeGLError(GL_INVALID_VALUE, "getActiveUniformBlockName", "invali
      d uniform block index"); | 
|  2635         return String(); |  2635         return String(); | 
|  2636     } |  2636     } | 
|  2637     OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); |  2637     OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]); | 
|  2638  |  2638  | 
|  2639     GLsizei length = 0; |  2639     GLsizei length = 0; | 
|  2640     webContext()->getActiveUniformBlockName(objectOrZero(program), uniformBlockI
      ndex, maxNameLength, &length, name.get()); |  2640     webContext()->getActiveUniformBlockName(objectOrZero(program), uniformBlockI
      ndex, maxNameLength, &length, name.get()); | 
|  2641  |  2641  | 
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2892  |  2892  | 
|  2893     default: |  2893     default: | 
|  2894         return WebGLRenderingContextBase::getParameter(scriptState, pname); |  2894         return WebGLRenderingContextBase::getParameter(scriptState, pname); | 
|  2895     } |  2895     } | 
|  2896 } |  2896 } | 
|  2897  |  2897  | 
|  2898 ScriptValue WebGL2RenderingContextBase::getInt64Parameter(ScriptState* scriptSta
      te, GLenum pname) |  2898 ScriptValue WebGL2RenderingContextBase::getInt64Parameter(ScriptState* scriptSta
      te, GLenum pname) | 
|  2899 { |  2899 { | 
|  2900     GLint64 value = 0; |  2900     GLint64 value = 0; | 
|  2901     if (!isContextLost()) |  2901     if (!isContextLost()) | 
|  2902         webContext()->getInteger64v(pname, &value); |  2902         contextGL()->GetInteger64v(pname, &value); | 
|  2903     return WebGLAny(scriptState, value); |  2903     return WebGLAny(scriptState, value); | 
|  2904 } |  2904 } | 
|  2905  |  2905  | 
|  2906 bool WebGL2RenderingContextBase::validateCapability(const char* functionName, GL
      enum cap) |  2906 bool WebGL2RenderingContextBase::validateCapability(const char* functionName, GL
      enum cap) | 
|  2907 { |  2907 { | 
|  2908     switch (cap) { |  2908     switch (cap) { | 
|  2909     case GL_RASTERIZER_DISCARD: |  2909     case GL_RASTERIZER_DISCARD: | 
|  2910         return true; |  2910         return true; | 
|  2911     default: |  2911     default: | 
|  2912         return WebGLRenderingContextBase::validateCapability(functionName, cap); |  2912         return WebGLRenderingContextBase::validateCapability(functionName, cap); | 
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3379         if (!attachmentObject->isTexture()) |  3379         if (!attachmentObject->isTexture()) | 
|  3380             break; |  3380             break; | 
|  3381     case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: |  3381     case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: | 
|  3382     case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: |  3382     case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: | 
|  3383     case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: |  3383     case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: | 
|  3384     case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: |  3384     case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: | 
|  3385     case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: |  3385     case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: | 
|  3386     case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: |  3386     case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: | 
|  3387         { |  3387         { | 
|  3388             GLint value = 0; |  3388             GLint value = 0; | 
|  3389             webContext()->getFramebufferAttachmentParameteriv(target, attachment
      , pname, &value); |  3389             contextGL()->GetFramebufferAttachmentParameteriv(target, attachment,
       pname, &value); | 
|  3390             return WebGLAny(scriptState, value); |  3390             return WebGLAny(scriptState, value); | 
|  3391         } |  3391         } | 
|  3392     case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: |  3392     case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: | 
|  3393         if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |  3393         if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { | 
|  3394             synthesizeGLError(GL_INVALID_OPERATION, kFunctionName, |  3394             synthesizeGLError(GL_INVALID_OPERATION, kFunctionName, | 
|  3395                 "COMPONENT_TYPE can't be queried for DEPTH_STENCIL_ATTACHMENT"); |  3395                 "COMPONENT_TYPE can't be queried for DEPTH_STENCIL_ATTACHMENT"); | 
|  3396             return ScriptValue::createNull(scriptState); |  3396             return ScriptValue::createNull(scriptState); | 
|  3397         } |  3397         } | 
|  3398     case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: |  3398     case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: | 
|  3399         { |  3399         { | 
|  3400             GLint value = 0; |  3400             GLint value = 0; | 
|  3401             webContext()->getFramebufferAttachmentParameteriv(target, attachment
      , pname, &value); |  3401             contextGL()->GetFramebufferAttachmentParameteriv(target, attachment,
       pname, &value); | 
|  3402             return WebGLAny(scriptState, static_cast<unsigned>(value)); |  3402             return WebGLAny(scriptState, static_cast<unsigned>(value)); | 
|  3403         } |  3403         } | 
|  3404     default: |  3404     default: | 
|  3405         break; |  3405         break; | 
|  3406     } |  3406     } | 
|  3407     synthesizeGLError(GL_INVALID_ENUM, kFunctionName, "invalid parameter name"); |  3407     synthesizeGLError(GL_INVALID_ENUM, kFunctionName, "invalid parameter name"); | 
|  3408     return ScriptValue::createNull(scriptState); |  3408     return ScriptValue::createNull(scriptState); | 
|  3409 } |  3409 } | 
|  3410  |  3410  | 
|  3411 DEFINE_TRACE(WebGL2RenderingContextBase) |  3411 DEFINE_TRACE(WebGL2RenderingContextBase) | 
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3461     if (isContextLost() || !validateTextureBinding("getTexParameter", target)) |  3461     if (isContextLost() || !validateTextureBinding("getTexParameter", target)) | 
|  3462         return ScriptValue::createNull(scriptState); |  3462         return ScriptValue::createNull(scriptState); | 
|  3463  |  3463  | 
|  3464     switch (pname) { |  3464     switch (pname) { | 
|  3465     case GL_TEXTURE_WRAP_R: |  3465     case GL_TEXTURE_WRAP_R: | 
|  3466     case GL_TEXTURE_COMPARE_FUNC: |  3466     case GL_TEXTURE_COMPARE_FUNC: | 
|  3467     case GL_TEXTURE_COMPARE_MODE: |  3467     case GL_TEXTURE_COMPARE_MODE: | 
|  3468     case GL_TEXTURE_IMMUTABLE_LEVELS: |  3468     case GL_TEXTURE_IMMUTABLE_LEVELS: | 
|  3469         { |  3469         { | 
|  3470             GLint value = 0; |  3470             GLint value = 0; | 
|  3471             webContext()->getTexParameteriv(target, pname, &value); |  3471             contextGL()->GetTexParameteriv(target, pname, &value); | 
|  3472             return WebGLAny(scriptState, static_cast<unsigned>(value)); |  3472             return WebGLAny(scriptState, static_cast<unsigned>(value)); | 
|  3473         } |  3473         } | 
|  3474     case GL_TEXTURE_IMMUTABLE_FORMAT: |  3474     case GL_TEXTURE_IMMUTABLE_FORMAT: | 
|  3475         { |  3475         { | 
|  3476             GLint value = 0; |  3476             GLint value = 0; | 
|  3477             webContext()->getTexParameteriv(target, pname, &value); |  3477             contextGL()->GetTexParameteriv(target, pname, &value); | 
|  3478             return WebGLAny(scriptState, static_cast<bool>(value)); |  3478             return WebGLAny(scriptState, static_cast<bool>(value)); | 
|  3479         } |  3479         } | 
|  3480     case GL_TEXTURE_BASE_LEVEL: |  3480     case GL_TEXTURE_BASE_LEVEL: | 
|  3481     case GL_TEXTURE_MAX_LEVEL: |  3481     case GL_TEXTURE_MAX_LEVEL: | 
|  3482         { |  3482         { | 
|  3483             GLint value = 0; |  3483             GLint value = 0; | 
|  3484             webContext()->getTexParameteriv(target, pname, &value); |  3484             contextGL()->GetTexParameteriv(target, pname, &value); | 
|  3485             return WebGLAny(scriptState, value); |  3485             return WebGLAny(scriptState, value); | 
|  3486         } |  3486         } | 
|  3487     case GL_TEXTURE_MAX_LOD: |  3487     case GL_TEXTURE_MAX_LOD: | 
|  3488     case GL_TEXTURE_MIN_LOD: |  3488     case GL_TEXTURE_MIN_LOD: | 
|  3489         { |  3489         { | 
|  3490             GLfloat value = 0.f; |  3490             GLfloat value = 0.f; | 
|  3491             webContext()->getTexParameterfv(target, pname, &value); |  3491             contextGL()->GetTexParameterfv(target, pname, &value); | 
|  3492             return WebGLAny(scriptState, value); |  3492             return WebGLAny(scriptState, value); | 
|  3493         } |  3493         } | 
|  3494     default: |  3494     default: | 
|  3495         return WebGLRenderingContextBase::getTexParameter(scriptState, target, p
      name); |  3495         return WebGLRenderingContextBase::getTexParameter(scriptState, target, p
      name); | 
|  3496     } |  3496     } | 
|  3497 } |  3497 } | 
|  3498  |  3498  | 
|  3499 WebGLBuffer* WebGL2RenderingContextBase::validateBufferDataTarget(const char* fu
      nctionName, GLenum target) |  3499 WebGLBuffer* WebGL2RenderingContextBase::validateBufferDataTarget(const char* fu
      nctionName, GLenum target) | 
|  3500 { |  3500 { | 
|  3501     WebGLBuffer* buffer = nullptr; |  3501     WebGLBuffer* buffer = nullptr; | 
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3592     params.skipPixels = m_unpackSkipPixels; |  3592     params.skipPixels = m_unpackSkipPixels; | 
|  3593     params.skipRows = m_unpackSkipRows; |  3593     params.skipRows = m_unpackSkipRows; | 
|  3594     if (dimension == Tex3D) { |  3594     if (dimension == Tex3D) { | 
|  3595         params.imageHeight = m_unpackImageHeight; |  3595         params.imageHeight = m_unpackImageHeight; | 
|  3596         params.skipImages = m_unpackSkipImages; |  3596         params.skipImages = m_unpackSkipImages; | 
|  3597     } |  3597     } | 
|  3598     return params; |  3598     return params; | 
|  3599 } |  3599 } | 
|  3600  |  3600  | 
|  3601 } // namespace blink |  3601 } // namespace blink | 
| OLD | NEW |