| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 bool HTMLCanvasElement::shouldBeDirectComposited() const | 274 bool HTMLCanvasElement::shouldBeDirectComposited() const |
| 275 { | 275 { |
| 276 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf
fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge); | 276 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf
fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge); |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool HTMLCanvasElement::isPaintable() const | 279 bool HTMLCanvasElement::isPaintable() const |
| 280 { | 280 { |
| 281 return (m_context && m_context->isPaintable()) || ImageBuffer::canCreateImag
eBuffer(size()); | 281 return (m_context && m_context->isPaintable()) || ImageBuffer::canCreateImag
eBuffer(size()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 bool HTMLCanvasElement::isAccelerated() const |
| 285 { |
| 286 return m_context && m_context->isAccelerated(); |
| 287 } |
| 288 |
| 284 void HTMLCanvasElement::didDraw(const FloatRect& rect) | 289 void HTMLCanvasElement::didDraw(const FloatRect& rect) |
| 285 { | 290 { |
| 286 if (rect.isEmpty()) | 291 if (rect.isEmpty()) |
| 287 return; | 292 return; |
| 288 m_imageBufferIsClear = false; | 293 m_imageBufferIsClear = false; |
| 289 clearCopiedImage(); | 294 clearCopiedImage(); |
| 290 if (layoutObject()) | 295 if (layoutObject()) |
| 291 layoutObject()->setMayNeedPaintInvalidation(); | 296 layoutObject()->setMayNeedPaintInvalidation(); |
| 292 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page()
&& page()->deviceScaleFactor() > 1.0f) { | 297 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page()
&& page()->deviceScaleFactor() > 1.0f) { |
| 293 FloatRect inflatedRect = rect; | 298 FloatRect inflatedRect = rect; |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 bool HTMLCanvasElement::createSurfaceLayer() | 1294 bool HTMLCanvasElement::createSurfaceLayer() |
| 1290 { | 1295 { |
| 1291 DCHECK(!m_surfaceLayerBridge); | 1296 DCHECK(!m_surfaceLayerBridge); |
| 1292 mojom::blink::OffscreenCanvasSurfacePtr service; | 1297 mojom::blink::OffscreenCanvasSurfacePtr service; |
| 1293 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&servi
ce)); | 1298 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&servi
ce)); |
| 1294 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(ser
vice))); | 1299 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(ser
vice))); |
| 1295 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1300 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1296 } | 1301 } |
| 1297 | 1302 |
| 1298 } // namespace blink | 1303 } // namespace blink |
| OLD | NEW |