Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 return; 1038 return;
1039 if (!validateHTMLImageElement("texSubImage3D", image, exceptionState)) 1039 if (!validateHTMLImageElement("texSubImage3D", image, exceptionState))
1040 return; 1040 return;
1041 if (!validateTexture3DBinding("texSubImage3D", target)) 1041 if (!validateTexture3DBinding("texSubImage3D", target))
1042 return; 1042 return;
1043 1043
1044 RefPtr<Image> imageForRender = image->cachedImage()->image(); 1044 RefPtr<Image> imageForRender = image->cachedImage()->image();
1045 if (imageForRender->isSVGImage()) 1045 if (imageForRender->isSVGImage())
1046 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width( ), image->height(), "texSubImage3D"); 1046 imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width( ), image->height(), "texSubImage3D");
1047 1047
1048 if (!imageForRender || !validateTexFunc("texSubImage3D", TexSubImage, Source HTMLImageElement, target, level, 0, imageForRender->width(), imageForRender->hei ght(), 1, 0, format, type, xoffset, yoffset, zoffset)) 1048 if (!imageForRender || !validateTexFunc("texSubImage3D", TexSubImage, Source HTMLImageElement, target, level, 0, imageForRender->defaultConcreteObjectSizeWid th(), imageForRender->defaultConcreteObjectSizeHeight(), 1, 0, format, type, xof fset, yoffset, zoffset))
1049 return; 1049 return;
1050 1050
1051 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im ageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackP remultiplyAlpha); 1051 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im ageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackP remultiplyAlpha);
1052 } 1052 }
1053 1053
1054 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLCanvasEl ement* canvas, ExceptionState& exceptionState) 1054 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLCanvasEl ement* canvas, ExceptionState& exceptionState)
1055 { 1055 {
1056 if (isContextLost()) 1056 if (isContextLost())
1057 return; 1057 return;
1058 if (!validateHTMLCanvasElement("texSubImage3D", canvas, exceptionState)) 1058 if (!validateHTMLCanvasElement("texSubImage3D", canvas, exceptionState))
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
3520 params.alignment = m_unpackAlignment; 3520 params.alignment = m_unpackAlignment;
3521 params.rowLength = m_unpackRowLength; 3521 params.rowLength = m_unpackRowLength;
3522 params.imageHeight = m_unpackImageHeight; 3522 params.imageHeight = m_unpackImageHeight;
3523 params.skipPixels = m_unpackSkipPixels; 3523 params.skipPixels = m_unpackSkipPixels;
3524 params.skipRows = m_unpackSkipRows; 3524 params.skipRows = m_unpackSkipRows;
3525 params.skipImages = m_unpackSkipImages; 3525 params.skipImages = m_unpackSkipImages;
3526 return params; 3526 return params;
3527 } 3527 }
3528 3528
3529 } // namespace blink 3529 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698