| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "SkTableColorFilter.h" | 8 #include "SkTableColorFilter.h" |
| 9 | 9 |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 texture.reset(GrRefCachedBitmapTexture(context, bitmap, GrTextureParams:
:ClampNoFilter())); | 480 texture.reset(GrRefCachedBitmapTexture(context, bitmap, GrTextureParams:
:ClampNoFilter())); |
| 481 } else { | 481 } else { |
| 482 texture.reset(SkRef(atlas->getTexture())); | 482 texture.reset(SkRef(atlas->getTexture())); |
| 483 } | 483 } |
| 484 | 484 |
| 485 return new ColorTableEffect(texture, atlas, row, flags); | 485 return new ColorTableEffect(texture, atlas, row, flags); |
| 486 } | 486 } |
| 487 | 487 |
| 488 ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atla
s, int row, | 488 ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atla
s, int row, |
| 489 unsigned flags) | 489 unsigned flags) |
| 490 : fTextureAccess(texture) | 490 : fTextureAccess(texture, "a") |
| 491 , fFlags(flags) | 491 , fFlags(flags) |
| 492 , fAtlas(atlas) | 492 , fAtlas(atlas) |
| 493 , fRow(row) { | 493 , fRow(row) { |
| 494 this->initClassID<ColorTableEffect>(); | 494 this->initClassID<ColorTableEffect>(); |
| 495 this->addTextureAccess(&fTextureAccess); | 495 this->addTextureAccess(&fTextureAccess); |
| 496 } | 496 } |
| 497 | 497 |
| 498 ColorTableEffect::~ColorTableEffect() { | 498 ColorTableEffect::~ColorTableEffect() { |
| 499 if (fAtlas) { | 499 if (fAtlas) { |
| 500 fAtlas->unlockRow(fRow); | 500 fAtlas->unlockRow(fRow); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], | 598 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], |
| 599 const uint8_t tableR[256], | 599 const uint8_t tableR[256], |
| 600 const uint8_t tableG[256], | 600 const uint8_t tableG[256], |
| 601 const uint8_t tableB[256]) { | 601 const uint8_t tableB[256]) { |
| 602 return new SkTable_ColorFilter(tableA, tableR, tableG, tableB); | 602 return new SkTable_ColorFilter(tableA, tableR, tableG, tableB); |
| 603 } | 603 } |
| 604 | 604 |
| 605 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) | 605 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) |
| 606 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) | 606 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) |
| 607 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 607 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |