tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "effects/GrSingleTextureEffect.h" |
tomhudson@google.com | aa72eab | 2012-07-19 18:01:07 +0000 | [diff] [blame] | 9 | |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 10 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 11 | sk_sp<GrColorSpaceXform> colorSpaceXform, |
Brian Salomon | 2ebd0c8 | 2016-10-03 17:15:28 -0400 | [diff] [blame] | 12 | const SkMatrix& m) |
| 13 | : fCoordTransform(m, texture, GrTextureParams::kNone_FilterMode) |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 14 | , fTextureSampler(texture) |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 15 | , fColorSpaceXform(std::move(colorSpaceXform)) { |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 16 | this->addCoordTransform(&fCoordTransform); |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 17 | this->addTextureSampler(&fTextureSampler); |
bsalomon@google.com | ae81d5c | 2013-03-20 17:32:27 +0000 | [diff] [blame] | 18 | } |
| 19 | |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 20 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 21 | sk_sp<GrColorSpaceXform> colorSpaceXform, |
bsalomon@google.com | ae81d5c | 2013-03-20 17:32:27 +0000 | [diff] [blame] | 22 | const SkMatrix& m, |
Brian Salomon | 2ebd0c8 | 2016-10-03 17:15:28 -0400 | [diff] [blame] | 23 | GrTextureParams::FilterMode filterMode) |
| 24 | : fCoordTransform(m, texture, filterMode) |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 25 | , fTextureSampler(texture, filterMode) |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 26 | , fColorSpaceXform(std::move(colorSpaceXform)) { |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 27 | this->addCoordTransform(&fCoordTransform); |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 28 | this->addTextureSampler(&fTextureSampler); |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame] | 29 | } |
| 30 | |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 31 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 32 | sk_sp<GrColorSpaceXform> colorSpaceXform, |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame] | 33 | const SkMatrix& m, |
Brian Salomon | 2ebd0c8 | 2016-10-03 17:15:28 -0400 | [diff] [blame] | 34 | const GrTextureParams& params) |
| 35 | : fCoordTransform(m, texture, params.filterMode()) |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 36 | , fTextureSampler(texture, params) |
brianosman | 54f30c1 | 2016-07-18 10:53:52 -0700 | [diff] [blame] | 37 | , fColorSpaceXform(std::move(colorSpaceXform)) { |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 38 | this->addCoordTransform(&fCoordTransform); |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 39 | this->addTextureSampler(&fTextureSampler); |
bsalomon@google.com | 1ce49fc | 2012-09-18 14:14:49 +0000 | [diff] [blame] | 40 | } |
| 41 | |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 42 | GrSingleTextureEffect::~GrSingleTextureEffect() { |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 43 | } |