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

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

Issue 1969923002: Fix sRGB textures that must be copied (for NPOT tiling, etc...) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | 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 "GrTextureParamsAdjuster.h" 8 #include "GrTextureParamsAdjuster.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture(rtDes c, 66 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture(rtDes c,
67 SkBud geted::kYes)); 67 SkBud geted::kYes));
68 if (!copy) { 68 if (!copy) {
69 return nullptr; 69 return nullptr;
70 } 70 }
71 71
72 // TODO: If no scaling is being performed then use copySurface. 72 // TODO: If no scaling is being performed then use copySurface.
73 73
74 GrPaint paint; 74 GrPaint paint;
75 paint.setGammaCorrect(true);
egdaniel 2016/05/11 22:04:46 so you have no conditional around this, so we alwa
Brian Osman 2016/05/12 01:01:35 This sets two flags on the paint (one that basical
75 76
76 // TODO: Initializing these values for no reason cause the compiler is compl aining 77 // TODO: Initializing these values for no reason cause the compiler is compl aining
77 SkScalar sx = 0.f; 78 SkScalar sx = 0.f;
78 SkScalar sy = 0.f; 79 SkScalar sy = 0.f;
79 if (subset) { 80 if (subset) {
80 sx = 1.f / inputTexture->width(); 81 sx = 1.f / inputTexture->width();
81 sy = 1.f / inputTexture->height(); 82 sy = 1.f / inputTexture->height();
82 } 83 }
83 84
84 if (copyParams.fFilter != GrTextureParams::kNone_FilterMode && subset && 85 if (copyParams.fFilter != GrTextureParams::kNone_FilterMode && subset &&
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 507 }
507 508
508 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams , 509 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams ,
509 bool willBeMipped) { 510 bool willBeMipped) {
510 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); 511 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped));
511 if (!original) { 512 if (!original) {
512 return nullptr; 513 return nullptr;
513 } 514 }
514 return copy_on_gpu(original, nullptr, copyParams); 515 return copy_on_gpu(original, nullptr, copyParams);
515 } 516 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698