| OLD | NEW |
| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 } | 503 } |
| 504 | 504 |
| 505 WebLayer* DrawingBuffer::platformLayer() | 505 WebLayer* DrawingBuffer::platformLayer() |
| 506 { | 506 { |
| 507 if (!m_layer) { | 507 if (!m_layer) { |
| 508 m_layer = adoptPtr(Platform::current()->compositorSupport()->createExter
nalTextureLayer(this)); | 508 m_layer = adoptPtr(Platform::current()->compositorSupport()->createExter
nalTextureLayer(this)); |
| 509 | 509 |
| 510 m_layer->setOpaque(!m_actualAttributes.alpha); | 510 m_layer->setOpaque(!m_actualAttributes.alpha); |
| 511 m_layer->setBlendBackgroundColor(m_actualAttributes.alpha); | 511 m_layer->setBlendBackgroundColor(m_actualAttributes.alpha); |
| 512 m_layer->setPremultipliedAlpha(m_actualAttributes.premultipliedAlpha); | 512 m_layer->setPremultipliedAlpha(m_actualAttributes.premultipliedAlpha); |
| 513 GraphicsLayer::registerContentsLayer(m_layer->layer()); | |
| 514 } | 513 } |
| 515 | 514 |
| 516 return m_layer->layer(); | 515 return m_layer->layer(); |
| 517 } | 516 } |
| 518 | 517 |
| 519 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer) | 518 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer) |
| 520 { | 519 { |
| 521 if (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR) | 520 if (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR) |
| 522 return; | 521 return; |
| 523 | 522 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 604 |
| 606 m_colorBuffer = TextureInfo(); | 605 m_colorBuffer = TextureInfo(); |
| 607 m_frontColorBuffer = TextureInfo(); | 606 m_frontColorBuffer = TextureInfo(); |
| 608 m_multisampleColorBuffer = 0; | 607 m_multisampleColorBuffer = 0; |
| 609 m_depthStencilBuffer = 0; | 608 m_depthStencilBuffer = 0; |
| 610 m_depthBuffer = 0; | 609 m_depthBuffer = 0; |
| 611 m_stencilBuffer = 0; | 610 m_stencilBuffer = 0; |
| 612 m_multisampleFBO = 0; | 611 m_multisampleFBO = 0; |
| 613 m_fbo = 0; | 612 m_fbo = 0; |
| 614 m_contextEvictionManager.clear(); | 613 m_contextEvictionManager.clear(); |
| 615 | |
| 616 if (m_layer) | |
| 617 GraphicsLayer::unregisterContentsLayer(m_layer->layer()); | |
| 618 } | 614 } |
| 619 | 615 |
| 620 unsigned DrawingBuffer::createColorTexture() | 616 unsigned DrawingBuffer::createColorTexture() |
| 621 { | 617 { |
| 622 unsigned offscreenColorTexture = m_context->createTexture(); | 618 unsigned offscreenColorTexture = m_context->createTexture(); |
| 623 if (!offscreenColorTexture) | 619 if (!offscreenColorTexture) |
| 624 return 0; | 620 return 0; |
| 625 | 621 |
| 626 m_context->bindTexture(GL_TEXTURE_2D, offscreenColorTexture); | 622 m_context->bindTexture(GL_TEXTURE_2D, offscreenColorTexture); |
| 627 m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 623 m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) | 1041 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) |
| 1046 { | 1042 { |
| 1047 if (info->imageId) { | 1043 if (info->imageId) { |
| 1048 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); | 1044 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); |
| 1049 m_context->destroyImageCHROMIUM(info->imageId); | 1045 m_context->destroyImageCHROMIUM(info->imageId); |
| 1050 info->imageId = 0; | 1046 info->imageId = 0; |
| 1051 } | 1047 } |
| 1052 } | 1048 } |
| 1053 | 1049 |
| 1054 } // namespace blink | 1050 } // namespace blink |
| OLD | NEW |