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

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

Issue 1434313002: Make all GrFragmentProcessors GL independent. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkTableColorFilter.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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 static inline int next_dither_toggle16(int toggle) { 289 static inline int next_dither_toggle16(int toggle) {
290 return toggle ^ SkGradientShaderBase::kDitherStride16; 290 return toggle ^ SkGradientShaderBase::kDitherStride16;
291 } 291 }
292 292
293 /////////////////////////////////////////////////////////////////////////////// 293 ///////////////////////////////////////////////////////////////////////////////
294 294
295 #if SK_SUPPORT_GPU 295 #if SK_SUPPORT_GPU
296 296
297 #include "GrCoordTransform.h" 297 #include "GrCoordTransform.h"
298 #include "GrFragmentProcessor.h" 298 #include "GrFragmentProcessor.h"
299 #include "gl/GrGLFragmentProcessor.h" 299 #include "glsl/GrGLSLFragmentProcessor.h"
300 #include "glsl/GrGLSLProgramDataManager.h" 300 #include "glsl/GrGLSLProgramDataManager.h"
301 301
302 class GrInvariantOutput; 302 class GrInvariantOutput;
303 303
304 /* 304 /*
305 * The interpretation of the texture matrix depends on the sample mode. The 305 * The interpretation of the texture matrix depends on the sample mode. The
306 * texture matrix is applied both when the texture coordinates are explicit 306 * texture matrix is applied both when the texture coordinates are explicit
307 * and when vertex positions are used as texture coordinates. In the latter 307 * and when vertex positions are used as texture coordinates. In the latter
308 * case the texture matrix is applied to the pre-view-matrix position 308 * case the texture matrix is applied to the pre-view-matrix position
309 * values. 309 * values.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 SkColor fColors[3]; // More than 3 colors we use texture 389 SkColor fColors[3]; // More than 3 colors we use texture
390 PremulType fPremulType; // This only changes behavior for two and three colo r special cases. 390 PremulType fPremulType; // This only changes behavior for two and three colo r special cases.
391 // It is already baked into to the table for texture gradients. 391 // It is already baked into to the table for texture gradients.
392 typedef GrFragmentProcessor INHERITED; 392 typedef GrFragmentProcessor INHERITED;
393 393
394 }; 394 };
395 395
396 /////////////////////////////////////////////////////////////////////////////// 396 ///////////////////////////////////////////////////////////////////////////////
397 397
398 // Base class for GL gradient effects 398 // Base class for GL gradient effects
399 class GrGLGradientEffect : public GrGLFragmentProcessor { 399 class GrGLGradientEffect : public GrGLSLFragmentProcessor {
400 public: 400 public:
401 GrGLGradientEffect(); 401 GrGLGradientEffect();
402 virtual ~GrGLGradientEffect(); 402 virtual ~GrGLGradientEffect();
403 403
404 protected: 404 protected:
405 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override ; 405 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override ;
406 406
407 protected: 407 protected:
408 /** 408 /**
409 * Subclasses must call this. It will return a key for the part of the shade r code controlled 409 * Subclasses must call this. It will return a key for the part of the shade r code controlled
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 kBaseKeyBitCnt = (kPremulTypeKeyBitCnt + kColorKeyBitCnt) 443 kBaseKeyBitCnt = (kPremulTypeKeyBitCnt + kColorKeyBitCnt)
444 }; 444 };
445 GR_STATIC_ASSERT(kBaseKeyBitCnt <= 32); 445 GR_STATIC_ASSERT(kBaseKeyBitCnt <= 32);
446 446
447 SkScalar fCachedYCoord; 447 SkScalar fCachedYCoord;
448 GrGLSLProgramDataManager::UniformHandle fFSYUni; 448 GrGLSLProgramDataManager::UniformHandle fFSYUni;
449 GrGLSLProgramDataManager::UniformHandle fColorStartUni; 449 GrGLSLProgramDataManager::UniformHandle fColorStartUni;
450 GrGLSLProgramDataManager::UniformHandle fColorMidUni; 450 GrGLSLProgramDataManager::UniformHandle fColorMidUni;
451 GrGLSLProgramDataManager::UniformHandle fColorEndUni; 451 GrGLSLProgramDataManager::UniformHandle fColorEndUni;
452 452
453 typedef GrGLFragmentProcessor INHERITED; 453 typedef GrGLSLFragmentProcessor INHERITED;
454 }; 454 };
455 455
456 #endif 456 #endif
457 457
458 #endif 458 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698