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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 158 if (!SkPaintToGrPaint(this->context(), paint, mat, |
159 this->surfaceProps().allowSRGBInputs(), &grPaint)) { | 159 this->surfaceProps().isGammaCorrect(), &grPaint)) { |
160 return; | 160 return; |
161 } | 161 } |
162 SkMatrix textureMat; | 162 SkMatrix textureMat; |
163 textureMat.reset(); | 163 textureMat.reset(); |
164 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width(); | 164 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width(); |
165 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height(); | 165 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height(); |
166 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width(); | 166 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width(); |
167 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height(); | 167 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height(); |
168 | 168 |
169 grPaint.addColorTextureProcessor(tex, textureMat); | 169 grPaint.addColorTextureProcessor(tex, textureMat); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 SkASSERT(nullptr == fGpu); | 410 SkASSERT(nullptr == fGpu); |
411 fGpu = new MockGpu(this, options); | 411 fGpu = new MockGpu(this, options); |
412 SkASSERT(fGpu); | 412 SkASSERT(fGpu); |
413 this->initCommon(options); | 413 this->initCommon(options); |
414 | 414 |
415 // 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 |
416 // 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 |
417 // resources in the buffer pools. | 417 // resources in the buffer pools. |
418 fDrawingManager->abandon(); | 418 fDrawingManager->abandon(); |
419 } | 419 } |
OLD | NEW |