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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrTextureAccess.h" 8 #include "GrTextureAccess.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
11 11
12 GrTextureAccess::GrTextureAccess() {} 12 GrTextureAccess::GrTextureAccess() {}
13 13
14 GrTextureAccess::GrTextureAccess(GrTexture* texture, const GrTextureParams& para ms) { 14 GrTextureAccess::GrTextureAccess(GrTexture* texture,
15 this->reset(texture, params); 15 sk_sp<GrColorSpaceXform> colorSpaceXform,
16 const GrTextureParams& params) {
17 this->reset(texture, std::move(colorSpaceXform), params);
16 } 18 }
17 19
18 GrTextureAccess::GrTextureAccess(GrTexture* texture, 20 GrTextureAccess::GrTextureAccess(GrTexture* texture,
21 sk_sp<GrColorSpaceXform> colorSpaceXform,
19 GrTextureParams::FilterMode filterMode, 22 GrTextureParams::FilterMode filterMode,
20 SkShader::TileMode tileXAndY, 23 SkShader::TileMode tileXAndY,
21 GrShaderFlags visibility) { 24 GrShaderFlags visibility) {
22 this->reset(texture, filterMode, tileXAndY, visibility); 25 this->reset(texture, std::move(colorSpaceXform), filterMode, tileXAndY, visi bility);
23 } 26 }
24 27
25 void GrTextureAccess::reset(GrTexture* texture, 28 void GrTextureAccess::reset(GrTexture* texture,
29 sk_sp<GrColorSpaceXform> colorSpaceXform,
26 const GrTextureParams& params, 30 const GrTextureParams& params,
27 GrShaderFlags visibility) { 31 GrShaderFlags visibility) {
28 SkASSERT(texture); 32 SkASSERT(texture);
29 fTexture.set(SkRef(texture), kRead_GrIOType); 33 fTexture.set(SkRef(texture), kRead_GrIOType);
30 fParams = params; 34 fParams = params;
31 fVisibility = visibility; 35 fVisibility = visibility;
36 fColorSpaceXform = std::move(colorSpaceXform);
32 } 37 }
33 38
34 void GrTextureAccess::reset(GrTexture* texture, 39 void GrTextureAccess::reset(GrTexture* texture,
40 sk_sp<GrColorSpaceXform> colorSpaceXform,
35 GrTextureParams::FilterMode filterMode, 41 GrTextureParams::FilterMode filterMode,
36 SkShader::TileMode tileXAndY, 42 SkShader::TileMode tileXAndY,
37 GrShaderFlags visibility) { 43 GrShaderFlags visibility) {
38 SkASSERT(texture); 44 SkASSERT(texture);
39 fTexture.set(SkRef(texture), kRead_GrIOType); 45 fTexture.set(SkRef(texture), kRead_GrIOType);
40 fParams.reset(tileXAndY, filterMode); 46 fParams.reset(tileXAndY, filterMode);
41 fVisibility = visibility; 47 fVisibility = visibility;
48 fColorSpaceXform = std::move(colorSpaceXform);
42 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698