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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return canCreateImageBuffer(size()); | 273 return canCreateImageBuffer(size()); |
274 return buffer(); | 274 return buffer(); |
275 } | 275 } |
276 | 276 |
277 void HTMLCanvasElement::didDraw(const FloatRect& rect) | 277 void HTMLCanvasElement::didDraw(const FloatRect& rect) |
278 { | 278 { |
279 if (rect.isEmpty()) | 279 if (rect.isEmpty()) |
280 return; | 280 return; |
281 m_imageBufferIsClear = false; | 281 m_imageBufferIsClear = false; |
282 clearCopiedImage(); | 282 clearCopiedImage(); |
283 if (layoutObject()) | 283 if (hasLayoutObject()) |
284 layoutObject()->setMayNeedPaintInvalidation(); | 284 layoutObject()->setMayNeedPaintInvalidation(); |
285 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page()
&& page()->deviceScaleFactor() > 1.0f) { | 285 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page()
&& page()->deviceScaleFactor() > 1.0f) { |
286 FloatRect inflatedRect = rect; | 286 FloatRect inflatedRect = rect; |
287 inflatedRect.inflate(1); | 287 inflatedRect.inflate(1); |
288 m_dirtyRect.unite(inflatedRect); | 288 m_dirtyRect.unite(inflatedRect); |
289 } else { | 289 } else { |
290 m_dirtyRect.unite(rect); | 290 m_dirtyRect.unite(rect); |
291 } | 291 } |
292 if (m_context && m_context->is2d() && hasImageBuffer()) | 292 if (m_context && m_context->is2d() && hasImageBuffer()) |
293 buffer()->didDraw(rect); | 293 buffer()->didDraw(rect); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 | 1188 |
1189 bool HTMLCanvasElement::createSurfaceLayer() | 1189 bool HTMLCanvasElement::createSurfaceLayer() |
1190 { | 1190 { |
1191 DCHECK(!m_surfaceLayerBridge); | 1191 DCHECK(!m_surfaceLayerBridge); |
1192 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1192 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
1193 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1193 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
1194 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1194 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
1195 } | 1195 } |
1196 | 1196 |
1197 } // namespace blink | 1197 } // namespace blink |
OLD | NEW |