| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 *status = NormalSourceImageStatus; | 1250 *status = NormalSourceImageStatus; |
| 1251 return placeholderFrame(); | 1251 return placeholderFrame(); |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 if (!m_context) { | 1254 if (!m_context) { |
| 1255 RefPtr<Image> result = createTransparentImage(size()); | 1255 RefPtr<Image> result = createTransparentImage(size()); |
| 1256 *status = result ? NormalSourceImageStatus : InvalidSourceImageStatus; | 1256 *status = result ? NormalSourceImageStatus : InvalidSourceImageStatus; |
| 1257 return result; | 1257 return result; |
| 1258 } | 1258 } |
| 1259 | 1259 |
| 1260 if (m_context->getContextType() == CanvasRenderingContext::ContextImageBitmap) | 1260 if (m_context->getContextType() == |
| 1261 CanvasRenderingContext::ContextImageBitmap) { |
| 1262 *status = NormalSourceImageStatus; |
| 1261 return m_context->getImage(hint, reason); | 1263 return m_context->getImage(hint, reason); |
| 1264 } |
| 1262 | 1265 |
| 1263 sk_sp<SkImage> skImage; | 1266 sk_sp<SkImage> skImage; |
| 1264 // TODO(ccameron): Canvas should produce sRGB images. | 1267 // TODO(ccameron): Canvas should produce sRGB images. |
| 1265 // https://crbug.com/672299 | 1268 // https://crbug.com/672299 |
| 1266 if (m_context->is3d()) { | 1269 if (m_context->is3d()) { |
| 1267 // Because WebGL sources always require making a copy of the back buffer, we | 1270 // Because WebGL sources always require making a copy of the back buffer, we |
| 1268 // use paintRenderingResultsToCanvas instead of getImage in order to keep a | 1271 // use paintRenderingResultsToCanvas instead of getImage in order to keep a |
| 1269 // cached copy of the backing in the canvas's ImageBuffer. | 1272 // cached copy of the backing in the canvas's ImageBuffer. |
| 1270 renderingContext()->paintRenderingResultsToCanvas(BackBuffer); | 1273 renderingContext()->paintRenderingResultsToCanvas(BackBuffer); |
| 1271 if (hasImageBuffer()) { | 1274 if (hasImageBuffer()) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 // Creates a placeholder layer first before Surface is created. | 1455 // Creates a placeholder layer first before Surface is created. |
| 1453 m_surfaceLayerBridge->createSolidColorLayer(); | 1456 m_surfaceLayerBridge->createSolidColorLayer(); |
| 1454 } | 1457 } |
| 1455 } | 1458 } |
| 1456 | 1459 |
| 1457 void HTMLCanvasElement::OnWebLayerReplaced() { | 1460 void HTMLCanvasElement::OnWebLayerReplaced() { |
| 1458 setNeedsCompositingUpdate(); | 1461 setNeedsCompositingUpdate(); |
| 1459 } | 1462 } |
| 1460 | 1463 |
| 1461 } // namespace blink | 1464 } // namespace blink |
| OLD | NEW |