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

Side by Side Diff: src/core/SkImageFilter.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 | « include/gpu/SkGpuDevice.h ('k') | src/effects/SkBicubicImageFilter.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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 GrAutoScratchTexture dst(context, desc); 120 GrAutoScratchTexture dst(context, desc);
121 GrContext::AutoMatrix am; 121 GrContext::AutoMatrix am;
122 am.setIdentity(context); 122 am.setIdentity(context);
123 GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget()); 123 GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget());
124 GrContext::AutoClip acs(context, rect); 124 GrContext::AutoClip acs(context, rect);
125 GrEffectRef* effect; 125 GrEffectRef* effect;
126 this->asNewEffect(&effect, srcTexture); 126 this->asNewEffect(&effect, srcTexture);
127 SkASSERT(effect); 127 SkASSERT(effect);
128 SkAutoUnref effectRef(effect); 128 SkAutoUnref effectRef(effect);
129 GrPaint paint; 129 GrPaint paint;
130 paint.colorStage(0)->setEffect(effect); 130 paint.addColorEffect(effect);
131 context->drawRect(paint, rect); 131 context->drawRect(paint, rect);
132 SkAutoTUnref<GrTexture> resultTex(dst.detach()); 132 SkAutoTUnref<GrTexture> resultTex(dst.detach());
133 SkImageFilterUtils::WrapTexture(resultTex, input.width(), input.height(), re sult); 133 SkImageFilterUtils::WrapTexture(resultTex, input.width(), input.height(), re sult);
134 return true; 134 return true;
135 #else 135 #else
136 return false; 136 return false;
137 #endif 137 #endif
138 } 138 }
139 139
140 bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, 140 bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
141 SkIRect* dst) { 141 SkIRect* dst) {
142 *dst = src; 142 *dst = src;
143 return true; 143 return true;
144 } 144 }
145 145
146 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*) const { 146 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*) const {
147 return false; 147 return false;
148 } 148 }
149 149
150 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 150 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
151 return false; 151 return false;
152 } 152 }
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/effects/SkBicubicImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698