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

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, 1 month 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 | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image.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) 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 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 m_gl->BindTexture(parameters.target, textureId); 1144 m_gl->BindTexture(parameters.target, textureId);
1145 m_gl->TexParameteri(parameters.target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 1145 m_gl->TexParameteri(parameters.target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1146 m_gl->TexParameteri(parameters.target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 1146 m_gl->TexParameteri(parameters.target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1147 m_gl->TexParameteri(parameters.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 1147 m_gl->TexParameteri(parameters.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1148 m_gl->TexParameteri(parameters.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 1148 m_gl->TexParameteri(parameters.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
1149 } 1149 }
1150 1150
1151 // If this is GpuMemoryBuffer-backed, then bind the texture to the 1151 // If this is GpuMemoryBuffer-backed, then bind the texture to the
1152 // GpuMemoryBuffer's GLImage. Otherwise, allocate ordinary texture storage. 1152 // GpuMemoryBuffer's GLImage. Otherwise, allocate ordinary texture storage.
1153 if (imageId) { 1153 if (imageId) {
1154 m_gl->BindTexImage2DCHROMIUM(parameters.target, imageId); 1154 m_gl->BindTexImage2DCHROMIUM(parameters.target, imageId, 0);
1155 } else { 1155 } else {
1156 if (m_storageTextureSupported) { 1156 if (m_storageTextureSupported) {
1157 GLenum internalStorageFormat = GL_NONE; 1157 GLenum internalStorageFormat = GL_NONE;
1158 if (parameters.creationInternalColorFormat == GL_RGB) { 1158 if (parameters.creationInternalColorFormat == GL_RGB) {
1159 internalStorageFormat = GL_RGB8; 1159 internalStorageFormat = GL_RGB8;
1160 } else if (parameters.creationInternalColorFormat == GL_RGBA) { 1160 } else if (parameters.creationInternalColorFormat == GL_RGBA) {
1161 internalStorageFormat = GL_RGBA8; 1161 internalStorageFormat = GL_RGBA8;
1162 } else { 1162 } else {
1163 NOTREACHED(); 1163 NOTREACHED();
1164 } 1164 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 if (m_pixelUnpackBufferBindingDirty) 1265 if (m_pixelUnpackBufferBindingDirty)
1266 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); 1266 client->DrawingBufferClientRestorePixelUnpackBufferBinding();
1267 } 1267 }
1268 1268
1269 bool DrawingBuffer::shouldUseChromiumImage() { 1269 bool DrawingBuffer::shouldUseChromiumImage() {
1270 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1270 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1271 m_chromiumImageUsage == AllowChromiumImage; 1271 m_chromiumImageUsage == AllowChromiumImage;
1272 } 1272 }
1273 1273
1274 } // namespace blink 1274 } // namespace blink
OLDNEW
« no previous file with comments | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698