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

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

Issue 1832923002: Clean up calls to CreateGpuMemoryBufferImageCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 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 | « gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc ('k') | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 Canvas2DLayerBridge::ImageInfo Canvas2DLayerBridge::createIOSurfaceBackedTexture () 247 Canvas2DLayerBridge::ImageInfo Canvas2DLayerBridge::createIOSurfaceBackedTexture ()
248 { 248 {
249 if (!m_imageInfoCache.isEmpty()) { 249 if (!m_imageInfoCache.isEmpty()) {
250 Canvas2DLayerBridge::ImageInfo info = m_imageInfoCache.last(); 250 Canvas2DLayerBridge::ImageInfo info = m_imageInfoCache.last();
251 m_imageInfoCache.removeLast(); 251 m_imageInfoCache.removeLast();
252 return info; 252 return info;
253 } 253 }
254 254
255 gpu::gles2::GLES2Interface* gl = contextGL(); 255 gpu::gles2::GLES2Interface* gl = contextGL();
256 GLuint imageId = gl->CreateGpuMemoryBufferImageCHROMIUM(m_size.width(), m_si ze.height(), GL_BGRA_EXT, GC3D_SCANOUT_CHROMIUM); 256 GLuint imageId = gl->CreateGpuMemoryBufferImageCHROMIUM(m_size.width(), m_si ze.height(), GL_RGBA, GC3D_SCANOUT_CHROMIUM);
257 if (!imageId) 257 if (!imageId)
258 return Canvas2DLayerBridge::ImageInfo(); 258 return Canvas2DLayerBridge::ImageInfo();
259 259
260 GLuint textureId; 260 GLuint textureId;
261 gl->GenTextures(1, &textureId); 261 gl->GenTextures(1, &textureId);
262 GLenum target = GC3D_TEXTURE_RECTANGLE_ARB; 262 GLenum target = GC3D_TEXTURE_RECTANGLE_ARB;
263 gl->BindTexture(target, textureId); 263 gl->BindTexture(target, textureId);
264 gl->TexParameteri(target, GL_TEXTURE_MAG_FILTER, getGLFilter()); 264 gl->TexParameteri(target, GL_TEXTURE_MAG_FILTER, getGLFilter());
265 gl->TexParameteri(target, GL_TEXTURE_MIN_FILTER, getGLFilter()); 265 gl->TexParameteri(target, GL_TEXTURE_MIN_FILTER, getGLFilter());
266 gl->TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 266 gl->TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 #endif // USE_IOSURFACE_FOR_2D_CANVAS 1001 #endif // USE_IOSURFACE_FOR_2D_CANVAS
1002 } 1002 }
1003 1003
1004 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) 1004 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event)
1005 { 1005 {
1006 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib ernationEvents", HibernationEventCount)); 1006 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib ernationEvents", HibernationEventCount));
1007 hibernationHistogram.count(event); 1007 hibernationHistogram.count(event);
1008 } 1008 }
1009 1009
1010 } // namespace blink 1010 } // namespace blink
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698