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

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

Issue 2639973002: Add target argument to Copy{Sub}TextureCHROMIUM entry point (Closed)
Patch Set: use dest_target instead of target Created 3 years, 11 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 const GLenum attachments[3] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, 348 const GLenum attachments[3] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT,
349 GL_STENCIL_ATTACHMENT}; 349 GL_STENCIL_ATTACHMENT};
350 m_stateRestorer->setFramebufferBindingDirty(); 350 m_stateRestorer->setFramebufferBindingDirty();
351 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); 351 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
352 m_gl->DiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments); 352 m_gl->DiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments);
353 } 353 }
354 } else { 354 } else {
355 // If we can't discard the backbuffer, create (or recycle) a buffer to put 355 // If we can't discard the backbuffer, create (or recycle) a buffer to put
356 // in the mailbox, and copy backbuffer's contents there. 356 // in the mailbox, and copy backbuffer's contents there.
357 colorBufferForMailbox = createOrRecycleColorBuffer(); 357 colorBufferForMailbox = createOrRecycleColorBuffer();
358 m_gl->CopySubTextureCHROMIUM( 358 m_gl->CopySubTextureCHROMIUM(m_backColorBuffer->textureId, 0,
359 m_backColorBuffer->textureId, 0, colorBufferForMailbox->textureId, 0, 0, 359 colorBufferForMailbox->parameters.target,
360 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); 360 colorBufferForMailbox->textureId, 0, 0, 0, 0,
361 0, m_size.width(), m_size.height(), GL_FALSE,
362 GL_FALSE, GL_FALSE);
361 } 363 }
362 364
363 // Put colorBufferForMailbox into its mailbox, and populate its 365 // Put colorBufferForMailbox into its mailbox, and populate its
364 // produceSyncToken with that point. 366 // produceSyncToken with that point.
365 { 367 {
366 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId, 368 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId,
367 colorBufferForMailbox->parameters.target, 369 colorBufferForMailbox->parameters.target,
368 colorBufferForMailbox->mailbox.name); 370 colorBufferForMailbox->mailbox.name);
369 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); 371 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM();
370 #if OS(MACOSX) 372 #if OS(MACOSX)
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name); 725 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name);
724 726
725 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; 727 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE;
726 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; 728 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE;
727 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) 729 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha)
728 unpackUnpremultiplyAlphaNeeded = GL_TRUE; 730 unpackUnpremultiplyAlphaNeeded = GL_TRUE;
729 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) 731 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha)
730 unpackPremultiplyAlphaNeeded = GL_TRUE; 732 unpackPremultiplyAlphaNeeded = GL_TRUE;
731 733
732 gl->CopySubTextureCHROMIUM( 734 gl->CopySubTextureCHROMIUM(
733 sourceTexture, 0, texture, 0, destTextureOffset.x(), 735 sourceTexture, 0, GL_TEXTURE_2D, texture, 0, destTextureOffset.x(),
734 destTextureOffset.y(), sourceSubRectangle.x(), sourceSubRectangle.y(), 736 destTextureOffset.y(), sourceSubRectangle.x(), sourceSubRectangle.y(),
735 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY, 737 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY,
736 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); 738 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded);
737 739
738 gl->DeleteTextures(1, &sourceTexture); 740 gl->DeleteTextures(1, &sourceTexture);
739 741
740 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); 742 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
741 743
742 gl->Flush(); 744 gl->Flush();
743 gpu::SyncToken syncToken; 745 gpu::SyncToken syncToken;
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (m_pixelUnpackBufferBindingDirty) 1268 if (m_pixelUnpackBufferBindingDirty)
1267 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); 1269 client->DrawingBufferClientRestorePixelUnpackBufferBinding();
1268 } 1270 }
1269 1271
1270 bool DrawingBuffer::shouldUseChromiumImage() { 1272 bool DrawingBuffer::shouldUseChromiumImage() {
1271 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1273 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1272 m_chromiumImageUsage == AllowChromiumImage; 1274 m_chromiumImageUsage == AllowChromiumImage;
1273 } 1275 }
1274 1276
1275 } // namespace blink 1277 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698