| 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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 | 1094 |
| 1095 if (!m_context) { | 1095 if (!m_context) { |
| 1096 *status = NormalSourceImageStatus; | 1096 *status = NormalSourceImageStatus; |
| 1097 return createTransparentImage(size()); | 1097 return createTransparentImage(size()); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 if (m_context->is3d()) { | 1100 if (m_context->is3d()) { |
| 1101 m_context->paintRenderingResultsToCanvas(BackBuffer); | 1101 m_context->paintRenderingResultsToCanvas(BackBuffer); |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 RefPtr<SkImage> skImage; | 1104 RefPtr<SkImage> image = buffer()->newSkImageSnapshot(hint, reason); |
| 1105 RefPtr<blink::Image> image = renderingContext()->getImage(); | 1105 if (image) { |
| 1106 | |
| 1107 if (image) | |
| 1108 skImage = image->imageForCurrentFrame(); | |
| 1109 else | |
| 1110 skImage = hasImageBuffer() ? buffer()->newSkImageSnapshot(hint, reason)
: createTransparentImage(size())->imageForCurrentFrame(); | |
| 1111 | |
| 1112 if (skImage) { | |
| 1113 *status = NormalSourceImageStatus; | 1106 *status = NormalSourceImageStatus; |
| 1114 return StaticBitmapImage::create(skImage.release()); | 1107 return StaticBitmapImage::create(image.release()); |
| 1115 } | 1108 } |
| 1116 | 1109 |
| 1117 *status = InvalidSourceImageStatus; | 1110 *status = InvalidSourceImageStatus; |
| 1118 return nullptr; | 1111 return nullptr; |
| 1119 } | 1112 } |
| 1120 | 1113 |
| 1121 bool HTMLCanvasElement::wouldTaintOrigin(SecurityOrigin*) const | 1114 bool HTMLCanvasElement::wouldTaintOrigin(SecurityOrigin*) const |
| 1122 { | 1115 { |
| 1123 return !originClean(); | 1116 return !originClean(); |
| 1124 } | 1117 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 | 1216 |
| 1224 bool HTMLCanvasElement::createSurfaceLayer() | 1217 bool HTMLCanvasElement::createSurfaceLayer() |
| 1225 { | 1218 { |
| 1226 DCHECK(!m_surfaceLayerBridge); | 1219 DCHECK(!m_surfaceLayerBridge); |
| 1227 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1220 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1228 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1221 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1229 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1222 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1230 } | 1223 } |
| 1231 | 1224 |
| 1232 } // namespace blink | 1225 } // namespace blink |
| OLD | NEW |