| 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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 { | 976 { |
| 977 if (!hasImageBuffer()) | 977 if (!hasImageBuffer()) |
| 978 return nullptr; | 978 return nullptr; |
| 979 | 979 |
| 980 return m_imageBuffer->canvas(); | 980 return m_imageBuffer->canvas(); |
| 981 } | 981 } |
| 982 | 982 |
| 983 ImageBuffer* HTMLCanvasElement::buffer() const | 983 ImageBuffer* HTMLCanvasElement::buffer() const |
| 984 { | 984 { |
| 985 DCHECK(m_context); | 985 DCHECK(m_context); |
| 986 DCHECK(m_context->getContextType() != CanvasRenderingContext::ContextImageBi
tmap); |
| 986 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer) | 987 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer) |
| 987 const_cast<HTMLCanvasElement*>(this)->createImageBuffer(); | 988 const_cast<HTMLCanvasElement*>(this)->createImageBuffer(); |
| 988 return m_imageBuffer.get(); | 989 return m_imageBuffer.get(); |
| 989 } | 990 } |
| 990 | 991 |
| 991 void HTMLCanvasElement::createImageBufferUsingSurfaceForTesting(std::unique_ptr<
ImageBufferSurface> surface) | 992 void HTMLCanvasElement::createImageBufferUsingSurfaceForTesting(std::unique_ptr<
ImageBufferSurface> surface) |
| 992 { | 993 { |
| 993 discardImageBuffer(); | 994 discardImageBuffer(); |
| 994 setWidth(surface->size().width()); | 995 setWidth(surface->size().width()); |
| 995 setHeight(surface->size().height()); | 996 setHeight(surface->size().height()); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 | 1217 |
| 1217 bool HTMLCanvasElement::createSurfaceLayer() | 1218 bool HTMLCanvasElement::createSurfaceLayer() |
| 1218 { | 1219 { |
| 1219 DCHECK(!m_surfaceLayerBridge); | 1220 DCHECK(!m_surfaceLayerBridge); |
| 1220 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1221 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1221 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1222 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1222 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1223 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1223 } | 1224 } |
| 1224 | 1225 |
| 1225 } // namespace blink | 1226 } // namespace blink |
| OLD | NEW |