| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "platform/graphics/GraphicsContext.h" | 29 #include "platform/graphics/GraphicsContext.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 CrossfadeGeneratedImage::CrossfadeGeneratedImage(PassRefPtr<Image> fromImage, | 33 CrossfadeGeneratedImage::CrossfadeGeneratedImage(PassRefPtr<Image> fromImage, |
| 34 PassRefPtr<Image> toImage, | 34 PassRefPtr<Image> toImage, |
| 35 float percentage, | 35 float percentage, |
| 36 IntSize crossfadeSize, | 36 IntSize crossfadeSize, |
| 37 const IntSize& size) | 37 const IntSize& size) |
| 38 : GeneratedImage(size), | 38 : GeneratedImage(size), |
| 39 m_fromImage(fromImage), | 39 m_fromImage(std::move(fromImage)), |
| 40 m_toImage(toImage), | 40 m_toImage(std::move(toImage)), |
| 41 m_percentage(percentage), | 41 m_percentage(percentage), |
| 42 m_crossfadeSize(crossfadeSize) {} | 42 m_crossfadeSize(crossfadeSize) {} |
| 43 | 43 |
| 44 void CrossfadeGeneratedImage::drawCrossfade(PaintCanvas* canvas, | 44 void CrossfadeGeneratedImage::drawCrossfade(PaintCanvas* canvas, |
| 45 const PaintFlags& flags, | 45 const PaintFlags& flags, |
| 46 ImageClampingMode clampMode) { | 46 ImageClampingMode clampMode) { |
| 47 FloatRect fromImageRect(FloatPoint(), FloatSize(m_fromImage->size())); | 47 FloatRect fromImageRect(FloatPoint(), FloatSize(m_fromImage->size())); |
| 48 FloatRect toImageRect(FloatPoint(), FloatSize(m_toImage->size())); | 48 FloatRect toImageRect(FloatPoint(), FloatSize(m_toImage->size())); |
| 49 FloatRect destRect((FloatPoint()), FloatSize(m_crossfadeSize)); | 49 FloatRect destRect((FloatPoint()), FloatSize(m_crossfadeSize)); |
| 50 | 50 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 PaintFlags flags = context.fillFlags(); | 105 PaintFlags flags = context.fillFlags(); |
| 106 flags.setBlendMode(SkBlendMode::kSrcOver); | 106 flags.setBlendMode(SkBlendMode::kSrcOver); |
| 107 flags.setAntiAlias(context.shouldAntialias()); | 107 flags.setAntiAlias(context.shouldAntialias()); |
| 108 FloatRect destRect((FloatPoint()), FloatSize(m_crossfadeSize)); | 108 FloatRect destRect((FloatPoint()), FloatSize(m_crossfadeSize)); |
| 109 flags.setFilterQuality(context.computeFilterQuality(this, destRect, srcRect)); | 109 flags.setFilterQuality(context.computeFilterQuality(this, destRect, srcRect)); |
| 110 drawCrossfade(context.canvas(), flags, ClampImageToSourceRect); | 110 drawCrossfade(context.canvas(), flags, ClampImageToSourceRect); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |