| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 if (ro && (!m_context || !m_context->isAccelerated())) { | 311 if (ro && (!m_context || !m_context->isAccelerated())) { |
| 312 LayoutRect mappedDirtyRect(enclosingIntRect(mapRect(m_dirtyRect, srcRect
, FloatRect(ro->contentBoxRect())))); | 312 LayoutRect mappedDirtyRect(enclosingIntRect(mapRect(m_dirtyRect, srcRect
, FloatRect(ro->contentBoxRect())))); |
| 313 // For querying PaintLayer::compositingState() | 313 // For querying PaintLayer::compositingState() |
| 314 // FIXME: is this invalidation using the correct compositing state? | 314 // FIXME: is this invalidation using the correct compositing state? |
| 315 DisableCompositingQueryAsserts disabler; | 315 DisableCompositingQueryAsserts disabler; |
| 316 ro->invalidatePaintRectangle(mappedDirtyRect); | 316 ro->invalidatePaintRectangle(mappedDirtyRect); |
| 317 } | 317 } |
| 318 m_dirtyRect = FloatRect(); | 318 m_dirtyRect = FloatRect(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void HTMLCanvasElement::didDisableAcceleration() |
| 322 { |
| 323 // We must force a paint invalidation on the canvas even if it's |
| 324 // content did not change because it layer was destroyed. |
| 325 didDraw(FloatRect(0, 0, size().width(), size().height())); |
| 326 } |
| 327 |
| 321 void HTMLCanvasElement::restoreCanvasMatrixClipStack(SkCanvas* canvas) const | 328 void HTMLCanvasElement::restoreCanvasMatrixClipStack(SkCanvas* canvas) const |
| 322 { | 329 { |
| 323 if (m_context) | 330 if (m_context) |
| 324 m_context->restoreCanvasMatrixClipStack(canvas); | 331 m_context->restoreCanvasMatrixClipStack(canvas); |
| 325 } | 332 } |
| 326 | 333 |
| 327 void HTMLCanvasElement::doDeferredPaintInvalidation() | 334 void HTMLCanvasElement::doDeferredPaintInvalidation() |
| 328 { | 335 { |
| 329 DCHECK(!m_dirtyRect.isEmpty()); | 336 DCHECK(!m_dirtyRect.isEmpty()); |
| 330 if (!m_context->is2d()) { | 337 if (!m_context->is2d()) { |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 | 1194 |
| 1188 bool HTMLCanvasElement::createSurfaceLayer() | 1195 bool HTMLCanvasElement::createSurfaceLayer() |
| 1189 { | 1196 { |
| 1190 DCHECK(!m_surfaceLayerBridge); | 1197 DCHECK(!m_surfaceLayerBridge); |
| 1191 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1198 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1192 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1199 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1193 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1200 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1194 } | 1201 } |
| 1195 | 1202 |
| 1196 } // namespace blink | 1203 } // namespace blink |
| OLD | NEW |