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

Side by Side Diff: src/effects/gradients/SkGradientShaderPriv.h

Issue 1490283004: Create GLSLUniformHandler class for gpu backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up public api of uniformhandler Created 5 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/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.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 Google Inc. 2 * Copyright 2012 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 #ifndef SkGradientShaderPriv_DEFINED 8 #ifndef SkGradientShaderPriv_DEFINED
9 #define SkGradientShaderPriv_DEFINED 9 #define SkGradientShaderPriv_DEFINED
10 10
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 protected: 412 protected:
413 /** 413 /**
414 * Subclasses must call this. It will return a key for the part of the shade r code controlled 414 * Subclasses must call this. It will return a key for the part of the shade r code controlled
415 * by the base class. The subclasses must stick it in their key and then pas s it to the below 415 * by the base class. The subclasses must stick it in their key and then pas s it to the below
416 * emit* functions from their emitCode function. 416 * emit* functions from their emitCode function.
417 */ 417 */
418 static uint32_t GenBaseGradientKey(const GrProcessor&); 418 static uint32_t GenBaseGradientKey(const GrProcessor&);
419 419
420 // Emits the uniform used as the y-coord to texture samples in derived class es. Subclasses 420 // Emits the uniform used as the y-coord to texture samples in derived class es. Subclasses
421 // should call this method from their emitCode(). 421 // should call this method from their emitCode().
422 void emitUniforms(GrGLSLFPBuilder* builder, const GrGradientEffect&); 422 void emitUniforms(GrGLSLUniformHandler*, const GrGradientEffect&);
423 423
424 424
425 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate 425 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate
426 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using 426 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using
427 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup. 427 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup.
428 void emitColor(GrGLSLFPBuilder* builder, 428 void emitColor(GrGLSLFragmentBuilder* fragBuilder,
429 GrGLSLFragmentBuilder* fragBuilder, 429 GrGLSLUniformHandler* uniformHandler,
430 const GrGLSLCaps* caps, 430 const GrGLSLCaps* caps,
431 const GrGradientEffect&, 431 const GrGradientEffect&,
432 const char* gradientTValue, 432 const char* gradientTValue,
433 const char* outputColor, 433 const char* outputColor,
434 const char* inputColor, 434 const char* inputColor,
435 const TextureSamplerArray& samplers); 435 const TextureSamplerArray& samplers);
436 436
437 private: 437 private:
438 enum { 438 enum {
439 kPremulTypeKeyBitCnt = 1, 439 kPremulTypeKeyBitCnt = 1,
(...skipping 16 matching lines...) Expand all
456 GrGLSLProgramDataManager::UniformHandle fColorStartUni; 456 GrGLSLProgramDataManager::UniformHandle fColorStartUni;
457 GrGLSLProgramDataManager::UniformHandle fColorMidUni; 457 GrGLSLProgramDataManager::UniformHandle fColorMidUni;
458 GrGLSLProgramDataManager::UniformHandle fColorEndUni; 458 GrGLSLProgramDataManager::UniformHandle fColorEndUni;
459 459
460 typedef GrGLSLFragmentProcessor INHERITED; 460 typedef GrGLSLFragmentProcessor INHERITED;
461 }; 461 };
462 462
463 #endif 463 #endif
464 464
465 #endif 465 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698