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

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

Issue 2037413002: Add SkSourceGammaTreatment enum so we know how to create mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix DM compilation Created 4 years, 6 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/SkPerlinNoiseShader.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 * 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 desc.fWidth = bitmap.width(); 466 desc.fWidth = bitmap.width();
467 desc.fHeight = 128; 467 desc.fHeight = 128;
468 desc.fRowHeight = bitmap.height(); 468 desc.fRowHeight = bitmap.height();
469 desc.fContext = context; 469 desc.fContext = context;
470 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info(), *context->caps()); 470 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info(), *context->caps());
471 GrTextureStripAtlas* atlas = GrTextureStripAtlas::GetAtlas(desc); 471 GrTextureStripAtlas* atlas = GrTextureStripAtlas::GetAtlas(desc);
472 int row = atlas->lockRow(bitmap); 472 int row = atlas->lockRow(bitmap);
473 SkAutoTUnref<GrTexture> texture; 473 SkAutoTUnref<GrTexture> texture;
474 if (-1 == row) { 474 if (-1 == row) {
475 atlas = nullptr; 475 atlas = nullptr;
476 texture.reset(GrRefCachedBitmapTexture(context, bitmap, GrTextureParams: :ClampNoFilter())); 476 texture.reset(GrRefCachedBitmapTexture(context, bitmap, GrTextureParams: :ClampNoFilter(),
477 SkSourceGammaTreatment::kRespect) );
477 } else { 478 } else {
478 texture.reset(SkRef(atlas->getTexture())); 479 texture.reset(SkRef(atlas->getTexture()));
479 } 480 }
480 481
481 return new ColorTableEffect(texture, atlas, row, flags); 482 return new ColorTableEffect(texture, atlas, row, flags);
482 } 483 }
483 484
484 ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atla s, int row, 485 ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atla s, int row,
485 unsigned flags) 486 unsigned flags)
486 : fTextureAccess(texture) 487 : fTextureAccess(texture)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 sk_sp<SkColorFilter> SkTableColorFilter::MakeARGB(const uint8_t tableA[256], 595 sk_sp<SkColorFilter> SkTableColorFilter::MakeARGB(const uint8_t tableA[256],
595 const uint8_t tableR[256], 596 const uint8_t tableR[256],
596 const uint8_t tableG[256], 597 const uint8_t tableG[256],
597 const uint8_t tableB[256]) { 598 const uint8_t tableB[256]) {
598 return sk_make_sp<SkTable_ColorFilter>(tableA, tableR, tableG, tableB); 599 return sk_make_sp<SkTable_ColorFilter>(tableA, tableR, tableG, tableB);
599 } 600 }
600 601
601 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) 602 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter)
602 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) 603 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter)
603 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 604 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698