Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 789163006: Add toString methods to SkImageFilter-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make sure leading 0's aren't stripped off colors Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkTileImageFilter.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 SkIntToScalar(foregroundOffset.fY), &paint); 91 SkIntToScalar(foregroundOffset.fY), &paint);
92 canvas.clipRect(SkRect::Make(foregroundBounds), SkRegion::kDifference_Op); 92 canvas.clipRect(SkRect::Make(foregroundBounds), SkRegion::kDifference_Op);
93 paint.setColor(SK_ColorTRANSPARENT); 93 paint.setColor(SK_ColorTRANSPARENT);
94 canvas.drawPaint(paint); 94 canvas.drawPaint(paint);
95 *dst = device->accessBitmap(false); 95 *dst = device->accessBitmap(false);
96 offset->fX = bounds.left(); 96 offset->fX = bounds.left();
97 offset->fY = bounds.top(); 97 offset->fY = bounds.top();
98 return true; 98 return true;
99 } 99 }
100 100
101 #ifndef SK_IGNORE_TO_STRING
102 void SkXfermodeImageFilter::toString(SkString* str) const {
103 str->appendf("SkXfermodeImageFilter: (");
104 str->appendf("xfermode: (");
105 if (fMode) {
106 fMode->toString(str);
107 }
108 str->append("))");
109 }
110 #endif
111
101 #if SK_SUPPORT_GPU 112 #if SK_SUPPORT_GPU
102 113
103 bool SkXfermodeImageFilter::canFilterImageGPU() const { 114 bool SkXfermodeImageFilter::canFilterImageGPU() const {
104 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet(); 115 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet();
105 } 116 }
106 117
107 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, 118 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
108 const SkBitmap& src, 119 const SkBitmap& src,
109 const Context& ctx, 120 const Context& ctx,
110 SkBitmap* result, 121 SkBitmap* result,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 paint.addColorProcessor(xferProcessor)->unref(); 169 paint.addColorProcessor(xferProcessor)->unref();
159 context->drawRect(paint, SkMatrix::I(), srcRect); 170 context->drawRect(paint, SkMatrix::I(), srcRect);
160 171
161 offset->fX = backgroundOffset.fX; 172 offset->fX = backgroundOffset.fX;
162 offset->fY = backgroundOffset.fY; 173 offset->fY = backgroundOffset.fY;
163 WrapTexture(dst, src.width(), src.height(), result); 174 WrapTexture(dst, src.width(), src.height(), result);
164 return true; 175 return true;
165 } 176 }
166 177
167 #endif 178 #endif
179
OLDNEW
« no previous file with comments | « src/effects/SkTileImageFilter.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698