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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 years, 2 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 const IntSize& size) { 1207 const IntSize& size) {
1208 if (!shouldUseChromiumImage()) 1208 if (!shouldUseChromiumImage())
1209 return createDefaultTextureAndAllocateMemory(size); 1209 return createDefaultTextureAndAllocateMemory(size);
1210 1210
1211 TextureParameters parameters = chromiumImageTextureParameters(); 1211 TextureParameters parameters = chromiumImageTextureParameters();
1212 GLuint imageId = m_gl->CreateGpuMemoryBufferImageCHROMIUM( 1212 GLuint imageId = m_gl->CreateGpuMemoryBufferImageCHROMIUM(
1213 size.width(), size.height(), parameters.creationInternalColorFormat, 1213 size.width(), size.height(), parameters.creationInternalColorFormat,
1214 GC3D_SCANOUT_CHROMIUM); 1214 GC3D_SCANOUT_CHROMIUM);
1215 GLuint textureId = createColorTexture(parameters); 1215 GLuint textureId = createColorTexture(parameters);
1216 if (imageId) { 1216 if (imageId) {
1217 m_gl->BindTexImage2DCHROMIUM(parameters.target, imageId); 1217 m_gl->BindTexImage2DCHROMIUM(parameters.target, imageId, 0);
1218 } 1218 }
1219 1219
1220 TextureInfo info; 1220 TextureInfo info;
1221 info.textureId = textureId; 1221 info.textureId = textureId;
1222 info.imageId = imageId; 1222 info.imageId = imageId;
1223 info.parameters = parameters; 1223 info.parameters = parameters;
1224 clearChromiumImageAlpha(info); 1224 clearChromiumImageAlpha(info);
1225 return info; 1225 return info;
1226 } 1226 }
1227 1227
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. 1284 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE.
1285 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); 1285 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding);
1286 } 1286 }
1287 1287
1288 bool DrawingBuffer::shouldUseChromiumImage() { 1288 bool DrawingBuffer::shouldUseChromiumImage() {
1289 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1289 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1290 m_chromiumImageUsage == AllowChromiumImage; 1290 m_chromiumImageUsage == AllowChromiumImage;
1291 } 1291 }
1292 1292
1293 } // namespace blink 1293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698