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

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 1228683002: rename GrShaderDataManager -> GrProcessorDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@grfixuptests
Patch Set: rebase onto origin/master Created 5 years, 5 months 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/core/SkColorShader.h ('k') | src/core/SkLocalMatrixShader.h » ('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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // setup new clip 269 // setup new clip
270 GrClip clip(dstRect); 270 GrClip clip(dstRect);
271 271
272 GrFragmentProcessor* fp; 272 GrFragmentProcessor* fp;
273 offset->fX = bounds.left(); 273 offset->fX = bounds.left();
274 offset->fY = bounds.top(); 274 offset->fY = bounds.top();
275 bounds.offset(-srcOffset); 275 bounds.offset(-srcOffset);
276 SkMatrix matrix(ctx.ctm()); 276 SkMatrix matrix(ctx.ctm());
277 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to p())); 277 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to p()));
278 GrPaint paint; 278 GrPaint paint;
279 if (this->asFragmentProcessor(&fp, paint.getShaderDataManager(), srcTexture, matrix, bounds)) { 279 if (this->asFragmentProcessor(&fp, paint.getProcessorDataManager(), srcTextu re, matrix, bounds)) {
280 SkASSERT(fp); 280 SkASSERT(fp);
281 paint.addColorProcessor(fp)->unref(); 281 paint.addColorProcessor(fp)->unref();
282 282
283 GrDrawContext* drawContext = context->drawContext(); 283 GrDrawContext* drawContext = context->drawContext();
284 if (drawContext) { 284 if (drawContext) {
285 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(), 285 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(),
286 dstRect, srcRect); 286 dstRect, srcRect);
287 287
288 WrapTexture(dst, bounds.width(), bounds.height(), result); 288 WrapTexture(dst, bounds.width(), bounds.height(), result);
289 return true; 289 return true;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 bounds.join(rect); 367 bounds.join(rect);
368 } 368 }
369 } 369 }
370 370
371 // don't modify dst until now, so we don't accidentally change it in the 371 // don't modify dst until now, so we don't accidentally change it in the
372 // loop, but then return false on the next filter. 372 // loop, but then return false on the next filter.
373 *dst = bounds; 373 *dst = bounds;
374 return true; 374 return true;
375 } 375 }
376 376
377 bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManag er*, GrTexture*, 377 bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrProcessorDataMa nager*, GrTexture*,
378 const SkMatrix&, const SkIRect&) const { 378 const SkMatrix&, const SkIRect&) const {
379 return false; 379 return false;
380 } 380 }
381 381
382 SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix, 382 SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix,
383 SkFilterQuality filterQuality, 383 SkFilterQuality filterQuality,
384 SkImageFilter* input) { 384 SkImageFilter* input) {
385 return SkMatrixImageFilter::Create(matrix, filterQuality, input); 385 return SkMatrixImageFilter::Create(matrix, filterQuality, input);
386 } 386 }
387 387
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 541 }
542 return dev; 542 return dev;
543 } 543 }
544 544
545 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm ap& src, 545 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm ap& src,
546 const SkImageFilter::Context& ctx, 546 const SkImageFilter::Context& ctx,
547 SkBitmap* result, SkIPoint* offset) { 547 SkBitmap* result, SkIPoint* offset) {
548 return fDevice->filterImage(filter, src, ctx, result, offset); 548 return fDevice->filterImage(filter, src, ctx, result, offset);
549 } 549 }
550 550
OLDNEW
« no previous file with comments | « src/core/SkColorShader.h ('k') | src/core/SkLocalMatrixShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698