blob: 3ab5e3ae057776af4dca9891fcadd510682ec813 [file] [log] [blame]
tomhudson@google.comd0c1a062012-07-12 17:23:52 +00001/*
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.comaa72eab2012-07-19 18:01:07 +00009
bsalomon@google.comc7818882013-03-20 19:19:53 +000010GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
11 const SkMatrix& m,
bsalomon@google.com77af6802013-10-02 13:04:56 +000012 GrCoordSet coordSet)
13 : fCoordTransform(coordSet, m, texture)
14 , fTextureAccess(texture) {
15 this->addCoordTransform(&fCoordTransform);
bsalomon@google.comae81d5c2013-03-20 17:32:27 +000016 this->addTextureAccess(&fTextureAccess);
17}
18
19GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
20 const SkMatrix& m,
humper@google.comb86add12013-07-25 18:49:07 +000021 GrTextureParams::FilterMode filterMode,
bsalomon@google.com77af6802013-10-02 13:04:56 +000022 GrCoordSet coordSet)
23 : fCoordTransform(coordSet, m, texture)
24 , fTextureAccess(texture, filterMode) {
25 this->addCoordTransform(&fCoordTransform);
bsalomon@google.comc7818882013-03-20 19:19:53 +000026 this->addTextureAccess(&fTextureAccess);
27}
28
29GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
30 const SkMatrix& m,
31 const GrTextureParams& params,
bsalomon@google.com77af6802013-10-02 13:04:56 +000032 GrCoordSet coordSet)
33 : fCoordTransform(coordSet, m, texture)
34 , fTextureAccess(texture, params) {
35 this->addCoordTransform(&fCoordTransform);
bsalomon@google.com50db75c2013-01-11 13:54:30 +000036 this->addTextureAccess(&fTextureAccess);
bsalomon@google.com1ce49fc2012-09-18 14:14:49 +000037}
38
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000039GrSingleTextureEffect::~GrSingleTextureEffect() {
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000040}