OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrTest.h" | 8 #include "GrTest.h" |
9 | 9 |
10 #include "GrBatchAtlas.h" | 10 #include "GrBatchAtlas.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 GrTexture* GrContext::getFontAtlasTexture(GrMaskFormat format) { | 148 GrTexture* GrContext::getFontAtlasTexture(GrMaskFormat format) { |
149 GrBatchFontCache* cache = this->getBatchFontCache(); | 149 GrBatchFontCache* cache = this->getBatchFontCache(); |
150 | 150 |
151 return cache->getTexture(format); | 151 return cache->getTexture(format); |
152 } | 152 } |
153 | 153 |
154 void SkGpuDevice::drawTexture(GrTexture* tex, const SkRect& dst, const SkPaint&
paint) { | 154 void SkGpuDevice::drawTexture(GrTexture* tex, const SkRect& dst, const SkPaint&
paint) { |
155 GrPaint grPaint; | 155 GrPaint grPaint; |
156 SkMatrix mat; | 156 SkMatrix mat; |
157 mat.reset(); | 157 mat.reset(); |
158 if (!SkPaintToGrPaint(this->context(), paint, mat, &grPaint)) { | 158 if (!SkPaintToGrPaint(this->context(), paint, mat, |
| 159 this->surfaceProps().allowSRGBInputs(), &grPaint)) { |
159 return; | 160 return; |
160 } | 161 } |
161 SkMatrix textureMat; | 162 SkMatrix textureMat; |
162 textureMat.reset(); | 163 textureMat.reset(); |
163 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width(); | 164 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width(); |
164 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height(); | 165 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height(); |
165 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width(); | 166 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width(); |
166 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height(); | 167 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height(); |
167 | 168 |
168 grPaint.addColorTextureProcessor(tex, textureMat); | 169 grPaint.addColorTextureProcessor(tex, textureMat); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 SkASSERT(nullptr == fGpu); | 410 SkASSERT(nullptr == fGpu); |
410 fGpu = new MockGpu(this, options); | 411 fGpu = new MockGpu(this, options); |
411 SkASSERT(fGpu); | 412 SkASSERT(fGpu); |
412 this->initCommon(options); | 413 this->initCommon(options); |
413 | 414 |
414 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 415 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
415 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 416 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
416 // resources in the buffer pools. | 417 // resources in the buffer pools. |
417 fDrawingManager->abandon(); | 418 fDrawingManager->abandon(); |
418 } | 419 } |
OLD | NEW |