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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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/SkPictureImageFilter.cpp ('k') | src/effects/gradients/SkGradientShader.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 #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 "SkReadBuffer.h" 5 #include "SkReadBuffer.h"
6 #include "SkWriteBuffer.h" 6 #include "SkWriteBuffer.h"
7 #include "SkUnPreMultiply.h" 7 #include "SkUnPreMultiply.h"
8 #include "SkString.h" 8 #include "SkString.h"
9 9
10 class SkTable_ColorFilter : public SkColorFilter { 10 class SkTable_ColorFilter : public SkColorFilter {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 SkTable_ColorFilter::kB_Flag | SkTable_ColorFilt er::kA_Flag; 431 SkTable_ColorFilter::kB_Flag | SkTable_ColorFilt er::kA_Flag;
432 return ColorTableEffect::Create(textures[GrEffectUnitTest::kAlphaTextureIdx] , kAllFlags); 432 return ColorTableEffect::Create(textures[GrEffectUnitTest::kAlphaTextureIdx] , kAllFlags);
433 } 433 }
434 434
435 GrEffect* SkTable_ColorFilter::asNewEffect(GrContext* context) const { 435 GrEffect* SkTable_ColorFilter::asNewEffect(GrContext* context) const {
436 SkBitmap bitmap; 436 SkBitmap bitmap;
437 GrEffect* effect = NULL; 437 GrEffect* effect = NULL;
438 this->asComponentTable(&bitmap); 438 this->asComponentTable(&bitmap);
439 // passing NULL because this effect does no tiling or filtering. 439 // passing NULL because this effect does no tiling or filtering.
440 GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, bitmap, NULL); 440 GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, bitmap, NULL);
441 if (NULL != texture) { 441 if (texture) {
442 effect = ColorTableEffect::Create(texture, fFlags); 442 effect = ColorTableEffect::Create(texture, fFlags);
443 443
444 // Unlock immediately, this is not great, but we don't have a way of 444 // Unlock immediately, this is not great, but we don't have a way of
445 // knowing when else to unlock it currently. TODO: Remove this when 445 // knowing when else to unlock it currently. TODO: Remove this when
446 // unref becomes the unlock replacement for all types of textures. 446 // unref becomes the unlock replacement for all types of textures.
447 GrUnlockAndUnrefCachedBitmapTexture(texture); 447 GrUnlockAndUnrefCachedBitmapTexture(texture);
448 } 448 }
449 return effect; 449 return effect;
450 } 450 }
451 451
(...skipping 18 matching lines...) Expand all
470 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], 470 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256],
471 const uint8_t tableR[256], 471 const uint8_t tableR[256],
472 const uint8_t tableG[256], 472 const uint8_t tableG[256],
473 const uint8_t tableB[256]) { 473 const uint8_t tableB[256]) {
474 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB)); 474 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB));
475 } 475 }
476 476
477 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) 477 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter)
478 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) 478 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter)
479 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 479 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkPictureImageFilter.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698