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

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: add assertion 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
« no previous file with comments | « no previous file | Source/modules/webgl/WebGLTexture.cpp » ('j') | 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 * 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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 } 2374 }
2375 2375
2376 void WebGLRenderingContextBase::generateMipmap(GLenum target) 2376 void WebGLRenderingContextBase::generateMipmap(GLenum target)
2377 { 2377 {
2378 if (isContextLost()) 2378 if (isContextLost())
2379 return; 2379 return;
2380 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); 2380 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false);
2381 if (!tex) 2381 if (!tex)
2382 return; 2382 return;
2383 if (!tex->canGenerateMipmaps()) { 2383 if (!tex->canGenerateMipmaps()) {
2384 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "level 0 not p ower of 2 or not all the same size"); 2384 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps");
2385 return; 2385 return;
2386 } 2386 }
2387 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm at(target, 0) == GL_SRGB_ALPHA_EXT) { 2387 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm at(target, 0) == GL_SRGB_ALPHA_EXT) {
2388 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps for sRGB textures"); 2388 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera te mipmaps for sRGB textures");
2389 return; 2389 return;
2390 } 2390 }
2391 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ et, 0))) 2391 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ et, 0)))
2392 return; 2392 return;
2393 2393
2394 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN EAR 2394 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN EAR
(...skipping 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after
6716 6716
6717 return totalBytesPerPixel; 6717 return totalBytesPerPixel;
6718 } 6718 }
6719 6719
6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6721 { 6721 {
6722 return m_drawingBuffer.get(); 6722 return m_drawingBuffer.get();
6723 } 6723 }
6724 6724
6725 } // namespace blink 6725 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webgl/WebGLTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698