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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp

Issue 1962413002: Implement transferToImageBitmap() in WebGLRenderingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { 78 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) {
79 String contextLabel(String::format("WebGLRenderingContext-%p", contextPr ovider)); 79 String contextLabel(String::format("WebGLRenderingContext-%p", contextPr ovider));
80 gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); 80 gl->PushGroupMarkerEXT(0, contextLabel.ascii().data());
81 } 81 }
82 return true; 82 return true;
83 } 83 }
84 84
85 CanvasRenderingContext* WebGLRenderingContext::Factory::create(ScriptState* scri ptState, OffscreenCanvas* offscreenCanvas, const CanvasContextCreationAttributes & attrs) 85 CanvasRenderingContext* WebGLRenderingContext::Factory::create(ScriptState* scri ptState, OffscreenCanvas* offscreenCanvas, const CanvasContextCreationAttributes & attrs)
86 { 86 {
87 WebGLContextAttributes attributes = toWebGLContextAttributes(attrs); 87 WebGLContextAttributes attributes = toWebGLContextAttributes(attrs);
88 // transferToImageBitmap calls paintRenderingResultsToImageData, which
89 // requires this bit to be false;
90 attributes.setPremultipliedAlpha(false);
Ken Russell (switch to Gerrit) 2016/05/10 23:11:42 I don't think it's legal to just set this all the
xidachen 2016/05/11 00:17:52 I did hesitate when I added this statement. The on
Ken Russell (switch to Gerrit) 2016/05/11 01:00:41 It's likely that that code path has never been tes
xidachen 2016/05/11 01:07:08 Yeah, it makes more sense to implement this using
88 OwnPtr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContex t3DProvider(scriptState, attributes, 1)); 91 OwnPtr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContex t3DProvider(scriptState, attributes, 1));
89 if (!shouldCreateContext(contextProvider.get())) 92 if (!shouldCreateContext(contextProvider.get()))
90 return nullptr; 93 return nullptr;
91 94
92 WebGLRenderingContext* renderingContext = new WebGLRenderingContext(offscree nCanvas, contextProvider.release(), attributes); 95 WebGLRenderingContext* renderingContext = new WebGLRenderingContext(offscree nCanvas, contextProvider.release(), attributes);
93 if (!renderingContext->drawingBuffer()) 96 if (!renderingContext->drawingBuffer())
94 return nullptr; 97 return nullptr;
95 renderingContext->initializeNewContext(); 98 renderingContext->initializeNewContext();
96 renderingContext->registerContextExtensions(); 99 renderingContext->registerContextExtensions();
97 100
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 result.setWebGLRenderingContext(this); 143 result.setWebGLRenderingContext(this);
141 } 144 }
142 145
143 void WebGLRenderingContext::setOffscreenCanvasGetContextResult(OffscreenRenderin gContext& result) 146 void WebGLRenderingContext::setOffscreenCanvasGetContextResult(OffscreenRenderin gContext& result)
144 { 147 {
145 result.setWebGLRenderingContext(this); 148 result.setWebGLRenderingContext(this);
146 } 149 }
147 150
148 ImageBitmap* WebGLRenderingContext::transferToImageBitmap(ExceptionState& except ionState) 151 ImageBitmap* WebGLRenderingContext::transferToImageBitmap(ExceptionState& except ionState)
149 { 152 {
150 NOTIMPLEMENTED(); 153 return transferToImageBitmapBase();
151 return nullptr;
152 } 154 }
153 155
154 void WebGLRenderingContext::registerContextExtensions() 156 void WebGLRenderingContext::registerContextExtensions()
155 { 157 {
156 // Register extensions. 158 // Register extensions.
157 static const char* const bothPrefixes[] = { "", "WEBKIT_", 0, }; 159 static const char* const bothPrefixes[] = { "", "WEBKIT_", 0, };
158 160
159 registerExtension<ANGLEInstancedArrays>(m_angleInstancedArrays); 161 registerExtension<ANGLEInstancedArrays>(m_angleInstancedArrays);
160 registerExtension<EXTBlendMinMax>(m_extBlendMinMax); 162 registerExtension<EXTBlendMinMax>(m_extBlendMinMax);
161 registerExtension<EXTDisjointTimerQuery>(m_extDisjointTimerQuery); 163 registerExtension<EXTDisjointTimerQuery>(m_extDisjointTimerQuery);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 visitor->trace(m_webglCompressedTextureASTC); 207 visitor->trace(m_webglCompressedTextureASTC);
206 visitor->trace(m_webglCompressedTextureATC); 208 visitor->trace(m_webglCompressedTextureATC);
207 visitor->trace(m_webglCompressedTextureETC1); 209 visitor->trace(m_webglCompressedTextureETC1);
208 visitor->trace(m_webglCompressedTexturePVRTC); 210 visitor->trace(m_webglCompressedTexturePVRTC);
209 visitor->trace(m_webglCompressedTextureS3TC); 211 visitor->trace(m_webglCompressedTextureS3TC);
210 visitor->trace(m_webglDepthTexture); 212 visitor->trace(m_webglDepthTexture);
211 WebGLRenderingContextBase::trace(visitor); 213 WebGLRenderingContextBase::trace(visitor);
212 } 214 }
213 215
214 } // namespace blink 216 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698