aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrCoordTransform.cpp
blob: 79d9e98b7677f745e6652b40586f6d7597fc5099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Copyright 2014 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrCoordTransform.h"
#include "GrResourceProvider.h"
#include "GrTextureProxy.h"

void GrCoordTransform::reset(GrResourceProvider* resourceProvider, const SkMatrix& m,
                             GrTextureProxy* proxy, bool normalize) {
    SkASSERT(proxy);
    SkASSERT(!fInProcessor);

    fMatrix = m;
    // MDB TODO: just GrCaps is needed for this method
    // MDB TODO: once all the coord transforms take a proxy just store it here and
    // instantiate later
    fTexture = proxy->instantiate(resourceProvider);
    fNormalize = normalize;
    fReverseY = kBottomLeft_GrSurfaceOrigin == proxy->origin();
}