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@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame] | 10 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
| 11 | const SkMatrix& m, |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 12 | GrCoordSet coordSet) |
| 13 | : fCoordTransform(coordSet, m, texture) |
| 14 | , fTextureAccess(texture) { |
| 15 | this->addCoordTransform(&fCoordTransform); |
bsalomon@google.com | ae81d5c | 2013-03-20 17:32:27 +0000 | [diff] [blame] | 16 | this->addTextureAccess(&fTextureAccess); |
| 17 | } |
| 18 | |
| 19 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
| 20 | const SkMatrix& m, |
humper@google.com | b86add1 | 2013-07-25 18:49:07 +0000 | [diff] [blame] | 21 | GrTextureParams::FilterMode filterMode, |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 22 | GrCoordSet coordSet) |
| 23 | : fCoordTransform(coordSet, m, texture) |
| 24 | , fTextureAccess(texture, filterMode) { |
| 25 | this->addCoordTransform(&fCoordTransform); |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame] | 26 | this->addTextureAccess(&fTextureAccess); |
| 27 | } |
| 28 | |
| 29 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, |
| 30 | const SkMatrix& m, |
| 31 | const GrTextureParams& params, |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 32 | GrCoordSet coordSet) |
| 33 | : fCoordTransform(coordSet, m, texture) |
| 34 | , fTextureAccess(texture, params) { |
| 35 | this->addCoordTransform(&fCoordTransform); |
bsalomon@google.com | 50db75c | 2013-01-11 13:54:30 +0000 | [diff] [blame] | 36 | this->addTextureAccess(&fTextureAccess); |
bsalomon@google.com | 1ce49fc | 2012-09-18 14:14:49 +0000 | [diff] [blame] | 37 | } |
| 38 | |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 39 | GrSingleTextureEffect::~GrSingleTextureEffect() { |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 40 | } |