blob: 26837894315ef8f56fd51dc6566b979309377bd8 [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
bsalomon4a339522015-10-06 08:40:50 -070010GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
brianosman54f30c12016-07-18 10:53:52 -070011 sk_sp<GrColorSpaceXform> colorSpaceXform,
Brian Salomon2ebd0c82016-10-03 17:15:28 -040012 const SkMatrix& m)
13 : fCoordTransform(m, texture, GrTextureParams::kNone_FilterMode)
brianosman54f30c12016-07-18 10:53:52 -070014 , fTextureAccess(texture)
15 , fColorSpaceXform(std::move(colorSpaceXform)) {
bsalomon@google.com77af6802013-10-02 13:04:56 +000016 this->addCoordTransform(&fCoordTransform);
bsalomon@google.comae81d5c2013-03-20 17:32:27 +000017 this->addTextureAccess(&fTextureAccess);
18}
19
bsalomon4a339522015-10-06 08:40:50 -070020GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
brianosman54f30c12016-07-18 10:53:52 -070021 sk_sp<GrColorSpaceXform> colorSpaceXform,
bsalomon@google.comae81d5c2013-03-20 17:32:27 +000022 const SkMatrix& m,
Brian Salomon2ebd0c82016-10-03 17:15:28 -040023 GrTextureParams::FilterMode filterMode)
24 : fCoordTransform(m, texture, filterMode)
brianosman54f30c12016-07-18 10:53:52 -070025 , fTextureAccess(texture, filterMode)
26 , fColorSpaceXform(std::move(colorSpaceXform)) {
bsalomon@google.com77af6802013-10-02 13:04:56 +000027 this->addCoordTransform(&fCoordTransform);
bsalomon@google.comc7818882013-03-20 19:19:53 +000028 this->addTextureAccess(&fTextureAccess);
29}
30
bsalomon4a339522015-10-06 08:40:50 -070031GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
brianosman54f30c12016-07-18 10:53:52 -070032 sk_sp<GrColorSpaceXform> colorSpaceXform,
bsalomon@google.comc7818882013-03-20 19:19:53 +000033 const SkMatrix& m,
Brian Salomon2ebd0c82016-10-03 17:15:28 -040034 const GrTextureParams& params)
35 : fCoordTransform(m, texture, params.filterMode())
brianosman54f30c12016-07-18 10:53:52 -070036 , fTextureAccess(texture, params)
37 , fColorSpaceXform(std::move(colorSpaceXform)) {
bsalomon@google.com77af6802013-10-02 13:04:56 +000038 this->addCoordTransform(&fCoordTransform);
bsalomon@google.com50db75c2013-01-11 13:54:30 +000039 this->addTextureAccess(&fTextureAccess);
bsalomon@google.com1ce49fc2012-09-18 14:14:49 +000040}
41
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000042GrSingleTextureEffect::~GrSingleTextureEffect() {
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000043}