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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 1147123006: Upgrade WebGLImageConversion to support WebGL 2 formats and types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
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 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 1543
1544 if (!validateCompressedTexSubDimensions("compressedTexSubImage2D", target, l evel, xoffset, yoffset, width, height, format, tex)) 1544 if (!validateCompressedTexSubDimensions("compressedTexSubImage2D", target, l evel, xoffset, yoffset, width, height, format, tex))
1545 return; 1545 return;
1546 1546
1547 webContext()->compressedTexSubImage2D(target, level, xoffset, yoffset, 1547 webContext()->compressedTexSubImage2D(target, level, xoffset, yoffset,
1548 width, height, format, data->byteLength(), data->baseAddress()); 1548 width, height, format, data->byteLength(), data->baseAddress());
1549 } 1549 }
1550 1550
1551 bool WebGLRenderingContextBase::validateSettableTexFormat(const char* functionNa me, GLenum format) 1551 bool WebGLRenderingContextBase::validateSettableTexFormat(const char* functionNa me, GLenum format)
1552 { 1552 {
1553 if (WebGLImageConversion::getClearBitsByFormat(format) & (GL_DEPTH_BUFFER_BI T | GL_STENCIL_BUFFER_BIT)) { 1553 if (WebGLImageConversion::getChannelBitsByFormat(format) & WebGLImageConvers ion::ChannelDepthStencil) {
1554 synthesizeGLError(GL_INVALID_OPERATION, functionName, "format can not be set, only rendered to"); 1554 synthesizeGLError(GL_INVALID_OPERATION, functionName, "format can not be set, only rendered to");
1555 return false; 1555 return false;
1556 } 1556 }
1557 return true; 1557 return true;
1558 } 1558 }
1559 1559
1560 void WebGLRenderingContextBase::copyTexImage2D(GLenum target, GLint level, GLenu m internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) 1560 void WebGLRenderingContextBase::copyTexImage2D(GLenum target, GLint level, GLenu m internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
1561 { 1561 {
1562 if (isContextLost()) 1562 if (isContextLost())
1563 return; 1563 return;
(...skipping 4688 matching lines...) Expand 10 before | Expand all | Expand 10 after
6252 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6252 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6253 } 6253 }
6254 #else 6254 #else
6255 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6255 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6256 { 6256 {
6257 return m_drawingBuffer.get(); 6257 return m_drawingBuffer.get();
6258 } 6258 }
6259 #endif 6259 #endif
6260 6260
6261 } // namespace blink 6261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698