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

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

Issue 26695005: separate state for msaa renderability (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: bool to int Created 7 years, 2 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/GrContext.h ('k') | src/gpu/GrClipMaskManager.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 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 "SkBitmapAlphaThresholdShader.h" 8 #include "SkBitmapAlphaThresholdShader.h"
9 9
10 class BATShader : public SkShader { 10 class BATShader : public SkShader {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return ThresholdEffect::Create(bmpTex, SkMatrix::I(), maskTex, SkMatrix::I() , thresh); 211 return ThresholdEffect::Create(bmpTex, SkMatrix::I(), maskTex, SkMatrix::I() , thresh);
212 } 212 }
213 213
214 GrEffectRef* BATShader::asNewEffect(GrContext* context, const SkPaint& paint) co nst { 214 GrEffectRef* BATShader::asNewEffect(GrContext* context, const SkPaint& paint) co nst {
215 SkMatrix localInverse; 215 SkMatrix localInverse;
216 if (!this->getLocalMatrix().invert(&localInverse)) { 216 if (!this->getLocalMatrix().invert(&localInverse)) {
217 return NULL; 217 return NULL;
218 } 218 }
219 219
220 GrTextureDesc maskDesc; 220 GrTextureDesc maskDesc;
221 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig)) { 221 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
222 maskDesc.fConfig = kAlpha_8_GrPixelConfig; 222 maskDesc.fConfig = kAlpha_8_GrPixelConfig;
223 } else { 223 } else {
224 maskDesc.fConfig = kRGBA_8888_GrPixelConfig; 224 maskDesc.fConfig = kRGBA_8888_GrPixelConfig;
225 } 225 }
226 maskDesc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagB it; 226 maskDesc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagB it;
227 const SkIRect& bounds = fRegion.getBounds(); 227 const SkIRect& bounds = fRegion.getBounds();
228 // Add one pixel of border to ensure that clamp mode will be all zeros 228 // Add one pixel of border to ensure that clamp mode will be all zeros
229 // the outside. 229 // the outside.
230 maskDesc.fWidth = bounds.width() + 2; 230 maskDesc.fWidth = bounds.width() + 2;
231 maskDesc.fHeight = bounds.height() + 2; 231 maskDesc.fHeight = bounds.height() + 2;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix, 268 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix,
269 maskTexture, maskMatrix, 269 maskTexture, maskMatrix,
270 fThreshold); 270 fThreshold);
271 271
272 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture); 272 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture);
273 273
274 return effect; 274 return effect;
275 } 275 }
276 276
277 #endif 277 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698