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

Side by Side Diff: tools/gpu/GrTest.cpp

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring 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 | « tests/SRGBMipMapTest.cpp ('k') | 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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 this->surfaceProps().isGammaCorrect(), &grPaint)) { 142 this->surfaceProps().isGammaCorrect(), &grPaint)) {
143 return; 143 return;
144 } 144 }
145 SkMatrix textureMat; 145 SkMatrix textureMat;
146 textureMat.reset(); 146 textureMat.reset();
147 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width(); 147 textureMat[SkMatrix::kMScaleX] = 1.0f/dst.width();
148 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height(); 148 textureMat[SkMatrix::kMScaleY] = 1.0f/dst.height();
149 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width(); 149 textureMat[SkMatrix::kMTransX] = -dst.fLeft/dst.width();
150 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height(); 150 textureMat[SkMatrix::kMTransY] = -dst.fTop/dst.height();
151 151
152 grPaint.addColorTextureProcessor(tex, textureMat); 152 grPaint.addColorTextureProcessor(tex, nullptr, textureMat);
153 153
154 fDrawContext->drawRect(GrNoClip(), grPaint, mat, dst); 154 fDrawContext->drawRect(GrNoClip(), grPaint, mat, dst);
155 } 155 }
156 156
157 157
158 #if GR_GPU_STATS 158 #if GR_GPU_STATS
159 void GrGpu::Stats::dump(SkString* out) { 159 void GrGpu::Stats::dump(SkString* out) {
160 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds); 160 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds);
161 out->appendf("Shader Compilations: %d\n", fShaderCompilations); 161 out->appendf("Shader Compilations: %d\n", fShaderCompilations);
162 out->appendf("Textures Created: %d\n", fTextureCreates); 162 out->appendf("Textures Created: %d\n", fTextureCreates);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 SkASSERT(nullptr == fGpu); 396 SkASSERT(nullptr == fGpu);
397 fGpu = new MockGpu(this, options); 397 fGpu = new MockGpu(this, options);
398 SkASSERT(fGpu); 398 SkASSERT(fGpu);
399 this->initCommon(options); 399 this->initCommon(options);
400 400
401 // We delete these because we want to test the cache starting with zero reso urces. Also, none of 401 // We delete these because we want to test the cache starting with zero reso urces. Also, none of
402 // these objects are required for any of tests that use this context. TODO: make stop allocating 402 // these objects are required for any of tests that use this context. TODO: make stop allocating
403 // resources in the buffer pools. 403 // resources in the buffer pools.
404 fDrawingManager->abandon(); 404 fDrawingManager->abandon();
405 } 405 }
OLDNEW
« no previous file with comments | « tests/SRGBMipMapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698