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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.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 "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 const TextureSamplerArray& samplers) { 384 const TextureSamplerArray& samplers) {
385 fPixelSizeUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility , 385 fPixelSizeUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility ,
386 kFloat_GrSLType, kDefault_GrSLPrecis ion, 386 kFloat_GrSLType, kDefault_GrSLPrecis ion,
387 "PixelSize"); 387 "PixelSize");
388 const char* pixelSizeInc = builder->getUniformCStr(fPixelSizeUni); 388 const char* pixelSizeInc = builder->getUniformCStr(fPixelSizeUni);
389 fRangeUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, 389 fRangeUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
390 kVec2f_GrSLType, kDefault_GrSLPrecis ion, 390 kVec2f_GrSLType, kDefault_GrSLPrecis ion,
391 "Range"); 391 "Range");
392 const char* range = builder->getUniformCStr(fRangeUni); 392 const char* range = builder->getUniformCStr(fRangeUni);
393 393
394 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 394 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
395 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0); 395 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
396 const char* func; 396 const char* func;
397 switch (fType) { 397 switch (fType) {
398 case GrMorphologyEffect::kErode_MorphologyType: 398 case GrMorphologyEffect::kErode_MorphologyType:
399 fsBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", outputColor); 399 fsBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", outputColor);
400 func = "min"; 400 func = "min";
401 break; 401 break;
402 case GrMorphologyEffect::kDilate_MorphologyType: 402 case GrMorphologyEffect::kDilate_MorphologyType:
403 fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor); 403 fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor);
404 func = "max"; 404 func = "max";
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 SkBitmap* result, SkIPoint* offset) con st { 747 SkBitmap* result, SkIPoint* offset) con st {
748 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 748 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
749 } 749 }
750 750
751 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 751 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
752 SkBitmap* result, SkIPoint* offset) cons t { 752 SkBitmap* result, SkIPoint* offset) cons t {
753 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 753 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
754 } 754 }
755 755
756 #endif 756 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698