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

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

Issue 2614663008: Migrate WTF::Vector::append() to ::push_back() [part 13 of N] (Closed)
Patch Set: Created 3 years, 11 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 /* 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 p->settings().getWebGLErrorsToConsoleEnabled(); 1297 p->settings().getWebGLErrorsToConsoleEnabled();
1298 } 1298 }
1299 } 1299 }
1300 1300
1301 m_isDepthStencilSupported = 1301 m_isDepthStencilSupported =
1302 extensionsUtil()->isExtensionEnabled("GL_OES_packed_depth_stencil"); 1302 extensionsUtil()->isExtensionEnabled("GL_OES_packed_depth_stencil");
1303 } 1303 }
1304 1304
1305 void WebGLRenderingContextBase::addCompressedTextureFormat(GLenum format) { 1305 void WebGLRenderingContextBase::addCompressedTextureFormat(GLenum format) {
1306 if (!m_compressedTextureFormats.contains(format)) 1306 if (!m_compressedTextureFormats.contains(format))
1307 m_compressedTextureFormats.append(format); 1307 m_compressedTextureFormats.push_back(format);
1308 } 1308 }
1309 1309
1310 void WebGLRenderingContextBase::removeAllCompressedTextureFormats() { 1310 void WebGLRenderingContextBase::removeAllCompressedTextureFormats() {
1311 m_compressedTextureFormats.clear(); 1311 m_compressedTextureFormats.clear();
1312 } 1312 }
1313 1313
1314 // Helper function for V8 bindings to identify what version of WebGL a 1314 // Helper function for V8 bindings to identify what version of WebGL a
1315 // CanvasRenderingContext supports. 1315 // CanvasRenderingContext supports.
1316 unsigned WebGLRenderingContextBase::getWebGLVersion( 1316 unsigned WebGLRenderingContextBase::getWebGLVersion(
1317 const CanvasRenderingContext* context) { 1317 const CanvasRenderingContext* context) {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 Nullable<HeapVector<Member<WebGLShader>>> 2686 Nullable<HeapVector<Member<WebGLShader>>>
2687 WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) { 2687 WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) {
2688 if (isContextLost() || !validateWebGLObject("getAttachedShaders", program)) 2688 if (isContextLost() || !validateWebGLObject("getAttachedShaders", program))
2689 return nullptr; 2689 return nullptr;
2690 2690
2691 HeapVector<Member<WebGLShader>> shaderObjects; 2691 HeapVector<Member<WebGLShader>> shaderObjects;
2692 const GLenum shaderType[] = {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER}; 2692 const GLenum shaderType[] = {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER};
2693 for (unsigned i = 0; i < sizeof(shaderType) / sizeof(GLenum); ++i) { 2693 for (unsigned i = 0; i < sizeof(shaderType) / sizeof(GLenum); ++i) {
2694 WebGLShader* shader = program->getAttachedShader(shaderType[i]); 2694 WebGLShader* shader = program->getAttachedShader(shaderType[i]);
2695 if (shader) 2695 if (shader)
2696 shaderObjects.append(shader); 2696 shaderObjects.push_back(shader);
2697 } 2697 }
2698 return shaderObjects; 2698 return shaderObjects;
2699 } 2699 }
2700 2700
2701 GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, 2701 GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program,
2702 const String& name) { 2702 const String& name) {
2703 if (isContextLost() || !validateWebGLObject("getAttribLocation", program)) 2703 if (isContextLost() || !validateWebGLObject("getAttribLocation", program))
2704 return -1; 2704 return -1;
2705 if (!validateLocationLength("getAttribLocation", name)) 2705 if (!validateLocationLength("getAttribLocation", name))
2706 return -1; 2706 return -1;
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
3385 return nullptr; 3385 return nullptr;
3386 3386
3387 Vector<String> result; 3387 Vector<String> result;
3388 3388
3389 for (size_t i = 0; i < m_extensions.size(); ++i) { 3389 for (size_t i = 0; i < m_extensions.size(); ++i) {
3390 ExtensionTracker* tracker = m_extensions[i].get(); 3390 ExtensionTracker* tracker = m_extensions[i].get();
3391 if (extensionSupportedAndAllowed(tracker)) { 3391 if (extensionSupportedAndAllowed(tracker)) {
3392 const char* const* prefixes = tracker->prefixes(); 3392 const char* const* prefixes = tracker->prefixes();
3393 for (; *prefixes; ++prefixes) { 3393 for (; *prefixes; ++prefixes) {
3394 String prefixedName = String(*prefixes) + tracker->extensionName(); 3394 String prefixedName = String(*prefixes) + tracker->extensionName();
3395 result.append(prefixedName); 3395 result.push_back(prefixedName);
3396 } 3396 }
3397 } 3397 }
3398 } 3398 }
3399 3399
3400 return result; 3400 return result;
3401 } 3401 }
3402 3402
3403 ScriptValue WebGLRenderingContextBase::getTexParameter(ScriptState* scriptState, 3403 ScriptValue WebGLRenderingContextBase::getTexParameter(ScriptState* scriptState,
3404 GLenum target, 3404 GLenum target,
3405 GLenum pname) { 3405 GLenum pname) {
(...skipping 4389 matching lines...) Expand 10 before | Expand all | Expand 10 after
7795 7795
7796 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7796 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7797 HTMLCanvasElementOrOffscreenCanvas& result) const { 7797 HTMLCanvasElementOrOffscreenCanvas& result) const {
7798 if (canvas()) 7798 if (canvas())
7799 result.setHTMLCanvasElement(canvas()); 7799 result.setHTMLCanvasElement(canvas());
7800 else 7800 else
7801 result.setOffscreenCanvas(offscreenCanvas()); 7801 result.setOffscreenCanvas(offscreenCanvas());
7802 } 7802 }
7803 7803
7804 } // namespace blink 7804 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698