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

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

Issue 13121002: Make GrGLShaderBuilder::TextureSampler extract only required info from GrTextureAccess. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 1
2 #include "SkBitmap.h" 2 #include "SkBitmap.h"
3 #include "SkTableColorFilter.h" 3 #include "SkTableColorFilter.h"
4 #include "SkColorPriv.h" 4 #include "SkColorPriv.h"
5 #include "SkFlattenableBuffers.h" 5 #include "SkFlattenableBuffers.h"
6 #include "SkUnPreMultiply.h" 6 #include "SkUnPreMultiply.h"
7 7
8 class SkTable_ColorFilter : public SkColorFilter { 8 class SkTable_ColorFilter : public SkColorFilter {
9 public: 9 public:
10 SkTable_ColorFilter(const uint8_t tableA[], const uint8_t tableR[], 10 SkTable_ColorFilter(const uint8_t tableA[], const uint8_t tableR[],
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 342
343 bool ColorTableEffect::onIsEqual(const GrEffect& sBase) const { 343 bool ColorTableEffect::onIsEqual(const GrEffect& sBase) const {
344 return this->texture(0) == sBase.texture(0); 344 return this->texture(0) == sBase.texture(0);
345 } 345 }
346 346
347 void ColorTableEffect::getConstantColorComponents(GrColor* color, uint32_t* vali dFlags) const { 347 void ColorTableEffect::getConstantColorComponents(GrColor* color, uint32_t* vali dFlags) const {
348 // If we kept the table in the effect then we could actually run known input s through the 348 // If we kept the table in the effect then we could actually run known input s through the
349 // table. 349 // table.
350 if (fFlags & SkTable_ColorFilter::kR_Flag) { 350 if (fFlags & SkTable_ColorFilter::kR_Flag) {
351 *validFlags &= ~kR_ValidComponentFlag; 351 *validFlags &= ~kR_GrColorComponentFlag;
352 } 352 }
353 if (fFlags & SkTable_ColorFilter::kG_Flag) { 353 if (fFlags & SkTable_ColorFilter::kG_Flag) {
354 *validFlags &= ~kG_ValidComponentFlag; 354 *validFlags &= ~kG_GrColorComponentFlag;
355 } 355 }
356 if (fFlags & SkTable_ColorFilter::kB_Flag) { 356 if (fFlags & SkTable_ColorFilter::kB_Flag) {
357 *validFlags &= ~kB_ValidComponentFlag; 357 *validFlags &= ~kB_GrColorComponentFlag;
358 } 358 }
359 if (fFlags & SkTable_ColorFilter::kA_Flag) { 359 if (fFlags & SkTable_ColorFilter::kA_Flag) {
360 *validFlags &= ~kA_ValidComponentFlag; 360 *validFlags &= ~kA_GrColorComponentFlag;
361 } 361 }
362 } 362 }
363 363
364 364
365 /////////////////////////////////////////////////////////////////////////////// 365 ///////////////////////////////////////////////////////////////////////////////
366 366
367 GR_DEFINE_EFFECT_TEST(ColorTableEffect); 367 GR_DEFINE_EFFECT_TEST(ColorTableEffect);
368 368
369 GrEffectRef* ColorTableEffect::TestCreate(SkMWCRandom* random, 369 GrEffectRef* ColorTableEffect::TestCreate(SkMWCRandom* random,
370 GrContext* context, 370 GrContext* context,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], 410 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256],
411 const uint8_t tableR[256], 411 const uint8_t tableR[256],
412 const uint8_t tableG[256], 412 const uint8_t tableG[256],
413 const uint8_t tableB[256]) { 413 const uint8_t tableB[256]) {
414 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB)); 414 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB));
415 } 415 }
416 416
417 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) 417 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter)
418 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) 418 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter)
419 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 419 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698