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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 2174843002: Connect dst color space in a few places (removing TODOs) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/gpu/GrTextureParamsAdjuster.cpp ('k') | src/gpu/SkGpuDevice_drawTexture.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 bitmap.height() <= fContext->caps()->maxTileSize())); 1097 bitmap.height() <= fContext->caps()->maxTileSize()));
1098 1098
1099 GrTexture* texture; 1099 GrTexture* texture;
1100 SkSourceGammaTreatment gammaTreatment = this->surfaceProps().isGammaCorrect( ) 1100 SkSourceGammaTreatment gammaTreatment = this->surfaceProps().isGammaCorrect( )
1101 ? SkSourceGammaTreatment::kRespect : SkSourceGammaTreatment::kIgnore; 1101 ? SkSourceGammaTreatment::kRespect : SkSourceGammaTreatment::kIgnore;
1102 AutoBitmapTexture abt(fContext, bitmap, params, gammaTreatment, &texture); 1102 AutoBitmapTexture abt(fContext, bitmap, params, gammaTreatment, &texture);
1103 if (nullptr == texture) { 1103 if (nullptr == texture) {
1104 return; 1104 return;
1105 } 1105 }
1106 1106
1107 SkColorSpace* dstColorSpace = nullptr; // XFORMTODO 1107 sk_sp<GrColorSpaceXform> colorSpaceXform =
1108 sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(bitmap.co lorSpace(), 1108 GrColorSpaceXform::Make(bitmap.colorSpace(), fDrawContext->getColorSpace ());
1109 dstColorS pace);
1110 SkRect dstRect = {0, 0, srcRect.width(), srcRect.height() }; 1109 SkRect dstRect = {0, 0, srcRect.width(), srcRect.height() };
1111 SkRect paintRect; 1110 SkRect paintRect;
1112 SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width())); 1111 SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width()));
1113 SkScalar hInv = SkScalarInvert(SkIntToScalar(texture->height())); 1112 SkScalar hInv = SkScalarInvert(SkIntToScalar(texture->height()));
1114 paintRect.setLTRB(SkScalarMul(srcRect.fLeft, wInv), 1113 paintRect.setLTRB(SkScalarMul(srcRect.fLeft, wInv),
1115 SkScalarMul(srcRect.fTop, hInv), 1114 SkScalarMul(srcRect.fTop, hInv),
1116 SkScalarMul(srcRect.fRight, wInv), 1115 SkScalarMul(srcRect.fRight, wInv),
1117 SkScalarMul(srcRect.fBottom, hInv)); 1116 SkScalarMul(srcRect.fBottom, hInv));
1118 1117
1119 SkMatrix texMatrix; 1118 SkMatrix texMatrix;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 } 1537 }
1539 1538
1540 static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_Filt erMode; 1539 static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_Filt erMode;
1541 bool gammaCorrect = this->surfaceProps().isGammaCorrect(); 1540 bool gammaCorrect = this->surfaceProps().isGammaCorrect();
1542 SkSourceGammaTreatment gammaTreatment = gammaCorrect 1541 SkSourceGammaTreatment gammaTreatment = gammaCorrect
1543 ? SkSourceGammaTreatment::kRespect : SkSourceGammaTreatment::kIgnore; 1542 ? SkSourceGammaTreatment::kRespect : SkSourceGammaTreatment::kIgnore;
1544 sk_sp<GrFragmentProcessor> fp( 1543 sk_sp<GrFragmentProcessor> fp(
1545 producer->createFragmentProcessor(SkMatrix::I(), 1544 producer->createFragmentProcessor(SkMatrix::I(),
1546 SkRect::MakeIWH(producer->width(), pro ducer->height()), 1545 SkRect::MakeIWH(producer->width(), pro ducer->height()),
1547 GrTextureProducer::kNo_FilterConstrain t, true, 1546 GrTextureProducer::kNo_FilterConstrain t, true,
1548 &kMode, gammaTreatment)); 1547 &kMode, fDrawContext->getColorSpace(), gammaTreatment));
1549 GrPaint grPaint; 1548 GrPaint grPaint;
1550 if (!SkPaintToGrPaintWithTexture(this->context(), paint, *draw.fMatrix, std: :move(fp), 1549 if (!SkPaintToGrPaintWithTexture(this->context(), paint, *draw.fMatrix, std: :move(fp),
1551 producer->isAlphaOnly(), gammaCorrect, &grP aint)) { 1550 producer->isAlphaOnly(), gammaCorrect, &grP aint)) {
1552 return; 1551 return;
1553 } 1552 }
1554 1553
1555 fDrawContext->drawImageNine(fClip, grPaint, *draw.fMatrix, producer->width() , 1554 fDrawContext->drawImageNine(fClip, grPaint, *draw.fMatrix, producer->width() ,
1556 producer->height(), center, dst); 1555 producer->height(), center, dst);
1557 } 1556 }
1558 1557
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 } 1870 }
1872 1871
1873 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { 1872 SkImageFilterCache* SkGpuDevice::getImageFilterCache() {
1874 ASSERT_SINGLE_OWNER 1873 ASSERT_SINGLE_OWNER
1875 // We always return a transient cache, so it is freed after each 1874 // We always return a transient cache, so it is freed after each
1876 // filter traversal. 1875 // filter traversal.
1877 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); 1876 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize);
1878 } 1877 }
1879 1878
1880 #endif 1879 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.cpp ('k') | src/gpu/SkGpuDevice_drawTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698