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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 if (imageBuffer) { | 315 if (imageBuffer) { |
316 CompositeOperator compositeOperator = !m_context || m_context->hasAl
pha() ? CompositeSourceOver : CompositeCopy; | 316 CompositeOperator compositeOperator = !m_context || m_context->hasAl
pha() ? CompositeSourceOver : CompositeCopy; |
317 if (m_presentedImage) | 317 if (m_presentedImage) |
318 context->drawImage(m_presentedImage.get(), pixelSnappedIntRect(r
), compositeOperator, DoNotRespectImageOrientation); | 318 context->drawImage(m_presentedImage.get(), pixelSnappedIntRect(r
), compositeOperator, DoNotRespectImageOrientation); |
319 else | 319 else |
320 context->drawImageBuffer(imageBuffer, pixelSnappedIntRect(r), 0,
compositeOperator); | 320 context->drawImageBuffer(imageBuffer, pixelSnappedIntRect(r), 0,
compositeOperator); |
321 } | 321 } |
322 } else { | 322 } else { |
323 // When alpha is false, we should draw to opaque black. | 323 // When alpha is false, we should draw to opaque black. |
324 if (m_context && !m_context->hasAlpha()) | 324 if (m_context && !m_context->hasAlpha()) |
325 context->fillRect(FloatRect(0, 0, width(), height()), Color(0, 0, 0)
); | 325 context->fillRect(FloatRect(r), Color(0, 0, 0)); |
326 } | 326 } |
327 | 327 |
328 if (is3D()) | 328 if (is3D()) |
329 toWebGLRenderingContext(m_context.get())->markLayerComposited(); | 329 toWebGLRenderingContext(m_context.get())->markLayerComposited(); |
330 } | 330 } |
331 | 331 |
332 bool HTMLCanvasElement::is3D() const | 332 bool HTMLCanvasElement::is3D() const |
333 { | 333 { |
334 return m_context && m_context->is3d(); | 334 return m_context && m_context->is3d(); |
335 } | 335 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 { | 698 { |
699 return !originClean(); | 699 return !originClean(); |
700 } | 700 } |
701 | 701 |
702 FloatSize HTMLCanvasElement::sourceSize() const | 702 FloatSize HTMLCanvasElement::sourceSize() const |
703 { | 703 { |
704 return FloatSize(width(), height()); | 704 return FloatSize(width(), height()); |
705 } | 705 } |
706 | 706 |
707 } | 707 } |
OLD | NEW |