OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 return false; | 283 return false; |
284 } | 284 } |
285 | 285 |
286 { | 286 { |
287 GrContext::AutoRenderTarget art(context, maskTexture->asRenderTarget
()); | 287 GrContext::AutoRenderTarget art(context, maskTexture->asRenderTarget
()); |
288 GrPaint grPaint; | 288 GrPaint grPaint; |
289 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 289 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
290 SkRegion::Iterator iter(fRegion); | 290 SkRegion::Iterator iter(fRegion); |
291 context->clear(NULL, 0x0, true, maskTexture->asRenderTarget()); | 291 context->clear(NULL, 0x0, true, maskTexture->asRenderTarget()); |
292 | 292 |
293 SkMatrix old_matrix = context->getMatrix(); | |
294 context->setMatrix(in_matrix); | |
295 | |
296 while (!iter.done()) { | 293 while (!iter.done()) { |
297 SkRect rect = SkRect::Make(iter.rect()); | 294 SkRect rect = SkRect::Make(iter.rect()); |
298 context->drawRect(grPaint, rect); | 295 context->drawRect(grPaint, in_matrix, rect); |
299 iter.next(); | 296 iter.next(); |
300 } | 297 } |
301 context->setMatrix(old_matrix); | |
302 } | 298 } |
303 | 299 |
304 *fp = AlphaThresholdEffect::Create(texture, | 300 *fp = AlphaThresholdEffect::Create(texture, |
305 maskTexture, | 301 maskTexture, |
306 fInnerThreshold, | 302 fInnerThreshold, |
307 fOuterThreshold); | 303 fOuterThreshold); |
308 } | 304 } |
309 return true; | 305 return true; |
310 } | 306 } |
311 #endif | 307 #endif |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 (U8CPU)(SkColorGetG(source) *
scale), | 367 (U8CPU)(SkColorGetG(source) *
scale), |
372 (U8CPU)(SkColorGetB(source) *
scale)); | 368 (U8CPU)(SkColorGetB(source) *
scale)); |
373 } | 369 } |
374 } | 370 } |
375 dptr[y * dst->width() + x] = output_color; | 371 dptr[y * dst->width() + x] = output_color; |
376 } | 372 } |
377 } | 373 } |
378 | 374 |
379 return true; | 375 return true; |
380 } | 376 } |
OLD | NEW |