| 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" |
| 11 #include "core/html/HTMLVideoElement.h" | 11 #include "core/html/HTMLVideoElement.h" |
| 12 #include "core/html/ImageData.h" | 12 #include "core/html/ImageData.h" |
| 13 #include "gpu/command_buffer/client/gles2_interface.h" |
| 13 #include "modules/webgl/WebGLActiveInfo.h" | 14 #include "modules/webgl/WebGLActiveInfo.h" |
| 14 #include "modules/webgl/WebGLBuffer.h" | 15 #include "modules/webgl/WebGLBuffer.h" |
| 15 #include "modules/webgl/WebGLFenceSync.h" | 16 #include "modules/webgl/WebGLFenceSync.h" |
| 16 #include "modules/webgl/WebGLFramebuffer.h" | 17 #include "modules/webgl/WebGLFramebuffer.h" |
| 17 #include "modules/webgl/WebGLProgram.h" | 18 #include "modules/webgl/WebGLProgram.h" |
| 18 #include "modules/webgl/WebGLQuery.h" | 19 #include "modules/webgl/WebGLQuery.h" |
| 19 #include "modules/webgl/WebGLRenderbuffer.h" | 20 #include "modules/webgl/WebGLRenderbuffer.h" |
| 20 #include "modules/webgl/WebGLSampler.h" | 21 #include "modules/webgl/WebGLSampler.h" |
| 21 #include "modules/webgl/WebGLSync.h" | 22 #include "modules/webgl/WebGLSync.h" |
| 22 #include "modules/webgl/WebGLTexture.h" | 23 #include "modules/webgl/WebGLTexture.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (!validateTexFuncLevel("framebufferTextureLayer", textarget, level)) | 301 if (!validateTexFuncLevel("framebufferTextureLayer", textarget, level)) |
| 301 return; | 302 return; |
| 302 } | 303 } |
| 303 | 304 |
| 304 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); | 305 WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); |
| 305 if (!framebufferBinding || !framebufferBinding->object()) { | 306 if (!framebufferBinding || !framebufferBinding->object()) { |
| 306 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTextureLayer", "no f
ramebuffer bound"); | 307 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTextureLayer", "no f
ramebuffer bound"); |
| 307 return; | 308 return; |
| 308 } | 309 } |
| 309 if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { | 310 if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| 310 webContext()->framebufferTextureLayer(target, GL_DEPTH_ATTACHMENT, objec
tOrZero(texture), level, layer); | 311 contextGL()->FramebufferTextureLayer(target, GL_DEPTH_ATTACHMENT, object
OrZero(texture), level, layer); |
| 311 webContext()->framebufferTextureLayer(target, GL_STENCIL_ATTACHMENT, obj
ectOrZero(texture), level, layer); | 312 contextGL()->FramebufferTextureLayer(target, GL_STENCIL_ATTACHMENT, obje
ctOrZero(texture), level, layer); |
| 312 } else { | 313 } else { |
| 313 webContext()->framebufferTextureLayer(target, attachment, objectOrZero(t
exture), level, layer); | 314 contextGL()->FramebufferTextureLayer(target, attachment, objectOrZero(te
xture), level, layer); |
| 314 } | 315 } |
| 315 if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { | 316 if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| 316 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. | 317 // On ES3, DEPTH_STENCIL_ATTACHMENT is like an alias for DEPTH_ATTACHMEN
T + STENCIL_ATTACHMENT. |
| 317 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. | 318 // We divide it here so in WebGLFramebuffer, we don't have to handle DEP
TH_STENCIL_ATTACHMENT in WebGL 2. |
| 318 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, textarget, texture, level, layer); | 319 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_AT
TACHMENT, textarget, texture, level, layer); |
| 319 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, textarget, texture, level, layer); | 320 framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_
ATTACHMENT, textarget, texture, level, layer); |
| 320 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, texture); | 321 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
DEPTH_ATTACHMENT, texture); |
| 321 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, texture); | 322 preserveObjectWrapper(scriptState, framebufferBinding, "attachment", GL_
STENCIL_ATTACHMENT, texture); |
| 322 } else { | 323 } else { |
| 323 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
textarget, texture, level, layer); | 324 framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment,
textarget, texture, level, layer); |
| (...skipping 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3591 params.skipPixels = m_unpackSkipPixels; | 3592 params.skipPixels = m_unpackSkipPixels; |
| 3592 params.skipRows = m_unpackSkipRows; | 3593 params.skipRows = m_unpackSkipRows; |
| 3593 if (dimension == Tex3D) { | 3594 if (dimension == Tex3D) { |
| 3594 params.imageHeight = m_unpackImageHeight; | 3595 params.imageHeight = m_unpackImageHeight; |
| 3595 params.skipImages = m_unpackSkipImages; | 3596 params.skipImages = m_unpackSkipImages; |
| 3596 } | 3597 } |
| 3597 return params; | 3598 return params; |
| 3598 } | 3599 } |
| 3599 | 3600 |
| 3600 } // namespace blink | 3601 } // namespace blink |
| OLD | NEW |