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

Side by Side Diff: src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp

Issue 1518843002: Use size_t for strlen() return value (Closed) Base URL: https://skia.googlesource.com/skia.git@strlen
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gl/SkGLContext.h" 8 #include "gl/SkGLContext.h"
9 9
10 #include <GLES2/gl2.h> 10 #include <GLES2/gl2.h>
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (!eglSwapBuffers(fDisplay, fSurface)) { 270 if (!eglSwapBuffers(fDisplay, fSurface)) {
271 SkDebugf("Could not complete eglSwapBuffers.\n"); 271 SkDebugf("Could not complete eglSwapBuffers.\n");
272 } 272 }
273 } 273 }
274 274
275 GrGLFuncPtr EGLGLContext::onPlatformGetProcAddress(const char* procName) const { 275 GrGLFuncPtr EGLGLContext::onPlatformGetProcAddress(const char* procName) const {
276 return eglGetProcAddress(procName); 276 return eglGetProcAddress(procName);
277 } 277 }
278 278
279 static bool supports_egl_extension(EGLDisplay display, const char* extension) { 279 static bool supports_egl_extension(EGLDisplay display, const char* extension) {
280 int extensionLength = strlen(extension); 280 size_t extensionLength = strlen(extension);
281 const char* extensionsStr = eglQueryString(display, EGL_EXTENSIONS); 281 const char* extensionsStr = eglQueryString(display, EGL_EXTENSIONS);
282 while (const char* match = strstr(extensionsStr, extension)) { 282 while (const char* match = strstr(extensionsStr, extension)) {
283 // Ensure the string we found is its own extension, not a substring of a larger extension 283 // Ensure the string we found is its own extension, not a substring of a larger extension
284 // (e.g. GL_ARB_occlusion_query / GL_ARB_occlusion_query2). 284 // (e.g. GL_ARB_occlusion_query / GL_ARB_occlusion_query2).
285 if ((match == extensionsStr || match[-1] == ' ') && 285 if ((match == extensionsStr || match[-1] == ' ') &&
286 (match[extensionLength] == ' ' || match[extensionLength] == '\0')) { 286 (match[extensionLength] == ' ' || match[extensionLength] == '\0')) {
287 return true; 287 return true;
288 } 288 }
289 extensionsStr = match + extensionLength; 289 extensionsStr = match + extensionLength;
290 } 290 }
(...skipping 28 matching lines...) Expand all
319 319
320 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { 320 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
321 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI); 321 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI);
322 if (!ctx->isValid()) { 322 if (!ctx->isValid()) {
323 delete ctx; 323 delete ctx;
324 return nullptr; 324 return nullptr;
325 } 325 }
326 return ctx; 326 return ctx;
327 } 327 }
328 328
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698