| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 bool HTMLCanvasElement::shouldBeDirectComposited() const | 251 bool HTMLCanvasElement::shouldBeDirectComposited() const |
| 252 { | 252 { |
| 253 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf
fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge); | 253 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf
fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge); |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool HTMLCanvasElement::isPaintable() const | 256 bool HTMLCanvasElement::isPaintable() const |
| 257 { | 257 { |
| 258 if (!m_context) | 258 if (!m_context) |
| 259 return ImageBuffer::canCreateImageBuffer(size()); | 259 return ImageBuffer::canCreateImageBuffer(size()); |
| 260 if (renderingContext()->getImage()) | 260 if (m_context->getContextType() == CanvasRenderingContext::ContextImageBitma
p) |
| 261 return true; | 261 return (renderingContext()->getImage().get()); |
| 262 return buffer(); | 262 return buffer(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void HTMLCanvasElement::didDraw(const FloatRect& rect) | 265 void HTMLCanvasElement::didDraw(const FloatRect& rect) |
| 266 { | 266 { |
| 267 if (rect.isEmpty()) | 267 if (rect.isEmpty()) |
| 268 return; | 268 return; |
| 269 m_imageBufferIsClear = false; | 269 m_imageBufferIsClear = false; |
| 270 clearCopiedImage(); | 270 clearCopiedImage(); |
| 271 if (layoutObject()) | 271 if (layoutObject()) |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 | 1233 |
| 1234 bool HTMLCanvasElement::createSurfaceLayer() | 1234 bool HTMLCanvasElement::createSurfaceLayer() |
| 1235 { | 1235 { |
| 1236 DCHECK(!m_surfaceLayerBridge); | 1236 DCHECK(!m_surfaceLayerBridge); |
| 1237 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1237 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1238 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1238 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1239 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1239 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 } // namespace blink | 1242 } // namespace blink |
| OLD | NEW |