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

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

Issue 788733003: Make addUniform take a precision (Closed) Base URL: https://skia.googlesource.com/skia.git@move_prec
Patch Set: rebase 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/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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 fType = m.type(); 346 fType = m.type();
347 } 347 }
348 348
349 void GrGLMorphologyEffect::emitCode(GrGLFPBuilder* builder, 349 void GrGLMorphologyEffect::emitCode(GrGLFPBuilder* builder,
350 const GrFragmentProcessor&, 350 const GrFragmentProcessor&,
351 const char* outputColor, 351 const char* outputColor,
352 const char* inputColor, 352 const char* inputColor,
353 const TransformedCoordsArray& coords, 353 const TransformedCoordsArray& coords,
354 const TextureSamplerArray& samplers) { 354 const TextureSamplerArray& samplers) {
355 fImageIncrementUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility, 355 fImageIncrementUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility,
356 kVec2f_GrSLType, "ImageIncrement"); 356 kVec2f_GrSLType, kDefault_GrSLPreci sion,
357 "ImageIncrement");
357 358
358 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 359 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
359 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0); 360 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
360 const char* func; 361 const char* func;
361 switch (fType) { 362 switch (fType) {
362 case GrMorphologyEffect::kErode_MorphologyType: 363 case GrMorphologyEffect::kErode_MorphologyType:
363 fsBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", outputColor); 364 fsBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", outputColor);
364 func = "min"; 365 func = "min";
365 break; 366 break;
366 case GrMorphologyEffect::kDilate_MorphologyType: 367 case GrMorphologyEffect::kDilate_MorphologyType:
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 SkBitmap* result, SkIPoint* offset) con st { 589 SkBitmap* result, SkIPoint* offset) con st {
589 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 590 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
590 } 591 }
591 592
592 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 593 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
593 SkBitmap* result, SkIPoint* offset) cons t { 594 SkBitmap* result, SkIPoint* offset) cons t {
594 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 595 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
595 } 596 }
596 597
597 #endif 598 #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