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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 { 526 {
527 if (m_contentsChanged) { 527 if (m_contentsChanged) {
528 if (m_antiAliasingMode != None) { 528 if (m_antiAliasingMode != None) {
529 commit(); 529 commit();
530 restoreFramebufferBindings(); 530 restoreFramebufferBindings();
531 } 531 }
532 m_gl->Flush(); 532 m_gl->Flush();
533 } 533 }
534 534
535 // Assume that the destination target is GL_TEXTURE_2D. 535 // Assume that the destination target is GL_TEXTURE_2D.
536 if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalForm at, destType, level)) 536 if (!m_extensionsUtil->canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalForm at, destType, level))
537 return false; 537 return false;
538 538
539 // Contexts may be in a different share group. We must transfer the texture through a mailbox first 539 // Contexts may be in a different share group. We must transfer the texture through a mailbox first
540 WebExternalTextureMailbox mailbox; 540 WebExternalTextureMailbox mailbox;
541 GLint textureId = 0; 541 GLint textureId = 0;
542 GLenum target = 0; 542 GLenum target = 0;
543 if (sourceBuffer == FrontBuffer && m_frontColorBuffer.texInfo.textureId) { 543 if (sourceBuffer == FrontBuffer && m_frontColorBuffer.texInfo.textureId) {
544 textureId = m_frontColorBuffer.texInfo.textureId; 544 textureId = m_frontColorBuffer.texInfo.textureId;
545 mailbox = m_frontColorBuffer.mailbox; 545 mailbox = m_frontColorBuffer.mailbox;
546 target = m_frontColorBuffer.texInfo.parameters.target; 546 target = m_frontColorBuffer.texInfo.parameters.target;
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 1112
1113 void DrawingBuffer::restoreTextureBindings() 1113 void DrawingBuffer::restoreTextureBindings()
1114 { 1114 {
1115 // This class potentially modifies the bindings for GL_TEXTURE_2D and 1115 // This class potentially modifies the bindings for GL_TEXTURE_2D and
1116 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since 1116 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since
1117 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. 1117 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE.
1118 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); 1118 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding);
1119 } 1119 }
1120 1120
1121 } // namespace blink 1121 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698