| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255); | 144 pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255); |
| 145 pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255); | 145 pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 paintToCanvas(pixels.get(), m_currentWidth, m_currentHeight, | 149 paintToCanvas(pixels.get(), m_currentWidth, m_currentHeight, |
| 150 canvas->width(), canvas->height(), imageBuffer->context()->pla
tformContext()); | 150 canvas->width(), canvas->height(), imageBuffer->context()->pla
tformContext()); |
| 151 } | 151 } |
| 152 #endif | 152 #endif |
| 153 | 153 |
| 154 bool GraphicsContext3D::paintCompositedResultsToCanvas(CanvasRenderingContext*) |
| 155 { |
| 156 // Not needed at the moment, so return that nothing was done. |
| 157 return false; |
| 158 } |
| 159 |
| 154 PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData() | 160 PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData() |
| 155 { | 161 { |
| 156 // Reading premultiplied alpha would involve unpremultiplying, which is | 162 // Reading premultiplied alpha would involve unpremultiplying, which is |
| 157 // lossy | 163 // lossy |
| 158 if (m_attrs.premultipliedAlpha) | 164 if (m_attrs.premultipliedAlpha) |
| 159 return 0; | 165 return 0; |
| 160 | 166 |
| 161 RefPtr<ImageData> imageData = ImageData::create(IntSize(m_currentWidth, m_cu
rrentHeight)); | 167 RefPtr<ImageData> imageData = ImageData::create(IntSize(m_currentWidth, m_cu
rrentHeight)); |
| 162 unsigned char* pixels = imageData->data()->data()->data(); | 168 unsigned char* pixels = imageData->data()->data()->data(); |
| 163 int totalBytes = 4 * m_currentWidth * m_currentHeight; | 169 int totalBytes = 4 * m_currentWidth * m_currentHeight; |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 { | 1534 { |
| 1529 if (!m_extensions) | 1535 if (!m_extensions) |
| 1530 m_extensions = adoptPtr(new Extensions3DOpenGL(this)); | 1536 m_extensions = adoptPtr(new Extensions3DOpenGL(this)); |
| 1531 return m_extensions.get(); | 1537 return m_extensions.get(); |
| 1532 } | 1538 } |
| 1533 #endif | 1539 #endif |
| 1534 | 1540 |
| 1535 } | 1541 } |
| 1536 | 1542 |
| 1537 #endif // ENABLE(WEBGL) | 1543 #endif // ENABLE(WEBGL) |
| OLD | NEW |