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

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

Issue 18686007: Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rob's comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkBlendImageFilter.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 "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 desc.fHeight = SkScalarCeilToInt(dstRect.height()); 358 desc.fHeight = SkScalarCeilToInt(dstRect.height());
359 desc.fConfig = kSkia8888_GrPixelConfig; 359 desc.fConfig = kSkia8888_GrPixelConfig;
360 360
361 GrAutoScratchTexture ast(context, desc); 361 GrAutoScratchTexture ast(context, desc);
362 SkAutoTUnref<GrTexture> dst(ast.detach()); 362 SkAutoTUnref<GrTexture> dst(ast.detach());
363 if (!dst) { 363 if (!dst) {
364 return false; 364 return false;
365 } 365 }
366 GrContext::AutoRenderTarget art(context, dst->asRenderTarget()); 366 GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
367 GrPaint paint; 367 GrPaint paint;
368 paint.colorStage(0)->setEffect(GrBicubicEffect::Create(srcTexture, fCoeffici ents))->unref(); 368 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref();
369 SkRect srcRect; 369 SkRect srcRect;
370 srcBM.getBounds(&srcRect); 370 srcBM.getBounds(&srcRect);
371 context->drawRectToRect(paint, dstRect, srcRect); 371 context->drawRectToRect(paint, dstRect, srcRect);
372 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t); 372 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t);
373 } 373 }
374 #endif 374 #endif
375 375
376 /////////////////////////////////////////////////////////////////////////////// 376 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkBlendImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698