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

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

Issue 1306343007: Fix base level for generateMipmap in blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 } 2363 }
2364 2364
2365 void WebGLRenderingContextBase::generateMipmap(GLenum target) 2365 void WebGLRenderingContextBase::generateMipmap(GLenum target)
2366 { 2366 {
2367 if (isContextLost()) 2367 if (isContextLost())
2368 return; 2368 return;
2369 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); 2369 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false);
2370 if (!tex) 2370 if (!tex)
2371 return; 2371 return;
2372 if (!tex->canGenerateMipmaps()) { 2372 if (!tex->canGenerateMipmaps()) {
2373 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "level 0 not p ower of 2 or not all the same size"); 2373 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps");
2374 return; 2374 return;
2375 } 2375 }
2376 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm at(target, 0) == GL_SRGB_ALPHA_EXT) { 2376 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm at(target, 0) == GL_SRGB_ALPHA_EXT) {
2377 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps for sRGB textures"); 2377 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps for sRGB textures");
2378 return; 2378 return;
2379 } 2379 }
2380 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ et, 0))) 2380 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ et, 0)))
2381 return; 2381 return;
2382 2382
2383 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN EAR 2383 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN EAR
(...skipping 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after
6687 6687
6688 return totalBytesPerPixel; 6688 return totalBytesPerPixel;
6689 } 6689 }
6690 6690
6691 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6691 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6692 { 6692 {
6693 return m_drawingBuffer.get(); 6693 return m_drawingBuffer.get();
6694 } 6694 }
6695 6695
6696 } // namespace blink 6696 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webgl/WebGLTexture.cpp » ('j') | Source/modules/webgl/WebGLTexture.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698