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

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

Issue 1160493002: Determine WebGL back-buffer on Mali-400 GPU Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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/platform/graphics/gpu/DrawingBuffer.h » ('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 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 if (isContextLost()) 1448 if (isContextLost())
1449 return; 1449 return;
1450 m_clearStencil = s; 1450 m_clearStencil = s;
1451 webContext()->clearStencil(s); 1451 webContext()->clearStencil(s);
1452 } 1452 }
1453 1453
1454 void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool ean blue, GLboolean alpha) 1454 void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool ean blue, GLboolean alpha)
1455 { 1455 {
1456 if (isContextLost()) 1456 if (isContextLost())
1457 return; 1457 return;
1458 if (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupporte d())
1459 alpha = GL_FALSE;
1460
1458 m_colorMask[0] = red; 1461 m_colorMask[0] = red;
1459 m_colorMask[1] = green; 1462 m_colorMask[1] = green;
1460 m_colorMask[2] = blue; 1463 m_colorMask[2] = blue;
1461 m_colorMask[3] = alpha; 1464 m_colorMask[3] = alpha;
1462 webContext()->colorMask(red, green, blue, alpha); 1465 webContext()->colorMask(red, green, blue, alpha);
1463 } 1466 }
1464 1467
1465 void WebGLRenderingContextBase::compileShader(WebGLShader* shader) 1468 void WebGLRenderingContextBase::compileShader(WebGLShader* shader)
1466 { 1469 {
1467 if (isContextLost() || !validateWebGLObject("compileShader", shader)) 1470 if (isContextLost() || !validateWebGLObject("compileShader", shader))
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 return ScriptValue::createNull(scriptState); 2380 return ScriptValue::createNull(scriptState);
2378 const int intZero = 0; 2381 const int intZero = 0;
2379 switch (pname) { 2382 switch (pname) {
2380 case GL_ACTIVE_TEXTURE: 2383 case GL_ACTIVE_TEXTURE:
2381 return getUnsignedIntParameter(scriptState, pname); 2384 return getUnsignedIntParameter(scriptState, pname);
2382 case GL_ALIASED_LINE_WIDTH_RANGE: 2385 case GL_ALIASED_LINE_WIDTH_RANGE:
2383 return getWebGLFloatArrayParameter(scriptState, pname); 2386 return getWebGLFloatArrayParameter(scriptState, pname);
2384 case GL_ALIASED_POINT_SIZE_RANGE: 2387 case GL_ALIASED_POINT_SIZE_RANGE:
2385 return getWebGLFloatArrayParameter(scriptState, pname); 2388 return getWebGLFloatArrayParameter(scriptState, pname);
2386 case GL_ALPHA_BITS: 2389 case GL_ALPHA_BITS:
2387 return getIntParameter(scriptState, pname); 2390 // Report 0 bits, if requested alpha attribute is false & drawingbuffer allocated as GL_RGBA
2391 return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTexture Supported())
2392 ? WebGLAny(scriptState, intZero)
2393 : getIntParameter(scriptState, pname);
2388 case GL_ARRAY_BUFFER_BINDING: 2394 case GL_ARRAY_BUFFER_BINDING:
2389 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_bound ArrayBuffer.get())); 2395 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_bound ArrayBuffer.get()));
2390 case GL_BLEND: 2396 case GL_BLEND:
2391 return getBooleanParameter(scriptState, pname); 2397 return getBooleanParameter(scriptState, pname);
2392 case GL_BLEND_COLOR: 2398 case GL_BLEND_COLOR:
2393 return getWebGLFloatArrayParameter(scriptState, pname); 2399 return getWebGLFloatArrayParameter(scriptState, pname);
2394 case GL_BLEND_DST_ALPHA: 2400 case GL_BLEND_DST_ALPHA:
2395 return getUnsignedIntParameter(scriptState, pname); 2401 return getUnsignedIntParameter(scriptState, pname);
2396 case GL_BLEND_DST_RGB: 2402 case GL_BLEND_DST_RGB:
2397 return getUnsignedIntParameter(scriptState, pname); 2403 return getUnsignedIntParameter(scriptState, pname);
2398 case GL_BLEND_EQUATION_ALPHA: 2404 case GL_BLEND_EQUATION_ALPHA:
2399 return getUnsignedIntParameter(scriptState, pname); 2405 return getUnsignedIntParameter(scriptState, pname);
2400 case GL_BLEND_EQUATION_RGB: 2406 case GL_BLEND_EQUATION_RGB:
2401 return getUnsignedIntParameter(scriptState, pname); 2407 return getUnsignedIntParameter(scriptState, pname);
2402 case GL_BLEND_SRC_ALPHA: 2408 case GL_BLEND_SRC_ALPHA:
2403 return getUnsignedIntParameter(scriptState, pname); 2409 return getUnsignedIntParameter(scriptState, pname);
2404 case GL_BLEND_SRC_RGB: 2410 case GL_BLEND_SRC_RGB:
2405 return getUnsignedIntParameter(scriptState, pname); 2411 return getUnsignedIntParameter(scriptState, pname);
2406 case GL_BLUE_BITS: 2412 case GL_BLUE_BITS:
2407 return getIntParameter(scriptState, pname); 2413 return getIntParameter(scriptState, pname);
2408 case GL_COLOR_CLEAR_VALUE: 2414 case GL_COLOR_CLEAR_VALUE:
2409 return getWebGLFloatArrayParameter(scriptState, pname); 2415 return getWebGLFloatArrayParameter(scriptState, pname);
2410 case GL_COLOR_WRITEMASK: 2416 case GL_COLOR_WRITEMASK:
2411 return getBooleanArrayParameter(scriptState, pname); 2417 return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTexture Supported())
2418 ? WebGLAny(scriptState, intZero)
2419 : getBooleanArrayParameter(scriptState, pname);
2412 case GL_COMPRESSED_TEXTURE_FORMATS: 2420 case GL_COMPRESSED_TEXTURE_FORMATS:
2413 return WebGLAny(scriptState, DOMUint32Array::create(m_compressedTextureF ormats.data(), m_compressedTextureFormats.size())); 2421 return WebGLAny(scriptState, DOMUint32Array::create(m_compressedTextureF ormats.data(), m_compressedTextureFormats.size()));
2414 case GL_CULL_FACE: 2422 case GL_CULL_FACE:
2415 return getBooleanParameter(scriptState, pname); 2423 return getBooleanParameter(scriptState, pname);
2416 case GL_CULL_FACE_MODE: 2424 case GL_CULL_FACE_MODE:
2417 return getUnsignedIntParameter(scriptState, pname); 2425 return getUnsignedIntParameter(scriptState, pname);
2418 case GL_CURRENT_PROGRAM: 2426 case GL_CURRENT_PROGRAM:
2419 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_curre ntProgram.get())); 2427 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_curre ntProgram.get()));
2420 case GL_DEPTH_BITS: 2428 case GL_DEPTH_BITS:
2421 if (!m_framebufferBinding && !m_requestedAttributes.depth()) 2429 if (!m_framebufferBinding && !m_requestedAttributes.depth())
(...skipping 3802 matching lines...) Expand 10 before | Expand all | Expand 10 after
6224 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6232 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6225 } 6233 }
6226 #else 6234 #else
6227 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6235 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6228 { 6236 {
6229 return m_drawingBuffer.get(); 6237 return m_drawingBuffer.get();
6230 } 6238 }
6231 #endif 6239 #endif
6232 6240
6233 } // namespace blink 6241 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698