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

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

Issue 787873002: Use threshold of 1 texture coord value per pixel w/ nearest neighbor. (Closed) Base URL: https://skia.googlesource.com/skia.git@matrix_prec
Patch Set: update comments Created 6 years 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/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; 80 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
81 81
82 private: 82 private:
83 AlphaThresholdEffect(GrTexture* texture, 83 AlphaThresholdEffect(GrTexture* texture,
84 GrTexture* maskTexture, 84 GrTexture* maskTexture,
85 float innerThreshold, 85 float innerThreshold,
86 float outerThreshold) 86 float outerThreshold)
87 : fInnerThreshold(innerThreshold) 87 : fInnerThreshold(innerThreshold)
88 , fOuterThreshold(outerThreshold) 88 , fOuterThreshold(outerThreshold)
89 , fImageCoordTransform(kLocal_GrCoordSet, 89 , fImageCoordTransform(kLocal_GrCoordSet,
90 GrCoordTransform::MakeDivByTextureWHMatrix(textur e), texture) 90 GrCoordTransform::MakeDivByTextureWHMatrix(textur e), texture,
91 GrTextureParams::kNone_FilterMode)
91 , fImageTextureAccess(texture) 92 , fImageTextureAccess(texture)
92 , fMaskCoordTransform(kLocal_GrCoordSet, 93 , fMaskCoordTransform(kLocal_GrCoordSet,
93 GrCoordTransform::MakeDivByTextureWHMatrix(maskTex ture), maskTexture) 94 GrCoordTransform::MakeDivByTextureWHMatrix(maskTex ture), maskTexture,
95 GrTextureParams::kNone_FilterMode)
94 , fMaskTextureAccess(maskTexture) { 96 , fMaskTextureAccess(maskTexture) {
95 this->initClassID<AlphaThresholdEffect>(); 97 this->initClassID<AlphaThresholdEffect>();
96 this->addCoordTransform(&fImageCoordTransform); 98 this->addCoordTransform(&fImageCoordTransform);
97 this->addTextureAccess(&fImageTextureAccess); 99 this->addTextureAccess(&fImageTextureAccess);
98 this->addCoordTransform(&fMaskCoordTransform); 100 this->addCoordTransform(&fMaskCoordTransform);
99 this->addTextureAccess(&fMaskTextureAccess); 101 this->addTextureAccess(&fMaskTextureAccess);
100 } 102 }
101 103
102 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; 104 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
103 105
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 (U8CPU)(SkColorGetG(source) * scale), 371 (U8CPU)(SkColorGetG(source) * scale),
370 (U8CPU)(SkColorGetB(source) * scale)); 372 (U8CPU)(SkColorGetB(source) * scale));
371 } 373 }
372 } 374 }
373 dptr[y * dst->width() + x] = output_color; 375 dptr[y * dst->width() + x] = output_color;
374 } 376 }
375 } 377 }
376 378
377 return true; 379 return true;
378 } 380 }
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698