| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkXfermodeImageFilter.h" | 8 #include "SkXfermodeImageFilter.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 paint.setXfermode(fMode); | 120 paint.setXfermode(fMode); |
| 121 | 121 |
| 122 if (foreground) { | 122 if (foreground) { |
| 123 foreground->draw(canvas, | 123 foreground->draw(canvas, |
| 124 SkIntToScalar(foregroundOffset.fX), SkIntToScalar(foreg
roundOffset.fY), | 124 SkIntToScalar(foregroundOffset.fX), SkIntToScalar(foreg
roundOffset.fY), |
| 125 &paint); | 125 &paint); |
| 126 } | 126 } |
| 127 | 127 |
| 128 canvas->clipRect(SkRect::Make(foregroundBounds), SkRegion::kDifference_Op); | 128 canvas->clipRect(SkRect::Make(foregroundBounds), SkCanvas::kDifference_Op); |
| 129 paint.setColor(SK_ColorTRANSPARENT); | 129 paint.setColor(SK_ColorTRANSPARENT); |
| 130 canvas->drawPaint(paint); | 130 canvas->drawPaint(paint); |
| 131 | 131 |
| 132 return surf->makeImageSnapshot(); | 132 return surf->makeImageSnapshot(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 #ifndef SK_IGNORE_TO_STRING | 135 #ifndef SK_IGNORE_TO_STRING |
| 136 void SkXfermodeImageFilter::toString(SkString* str) const { | 136 void SkXfermodeImageFilter::toString(SkString* str) const { |
| 137 str->appendf("SkXfermodeImageFilter: ("); | 137 str->appendf("SkXfermodeImageFilter: ("); |
| 138 str->appendf("xfermode: ("); | 138 str->appendf("xfermode: ("); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top
())); | 253 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top
())); |
| 254 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); | 254 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); |
| 255 | 255 |
| 256 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he
ight()), | 256 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he
ight()), |
| 257 kNeedNewImageUniqueID_SpecialImage, | 257 kNeedNewImageUniqueID_SpecialImage, |
| 258 drawContext->asTexture(), | 258 drawContext->asTexture(), |
| 259 sk_ref_sp(drawContext->getColorSpace())); | 259 sk_ref_sp(drawContext->getColorSpace())); |
| 260 } | 260 } |
| 261 | 261 |
| 262 #endif | 262 #endif |
| OLD | NEW |