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 "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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |