blob: 155f6828278ec6e631724cad1069f7cb56511352 [file] [log] [blame]
bsalomon@google.com047696c2012-09-11 13:29:29 +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 "GrTextureAccess.h"
9#include "SkString.h"
10
11GrTextureAccess::GrTextureAccess(const GrTexture* texture, const SkString& swizzle)
12 : fTexture(texture) {
13 GrAssert(swizzle.size() <= 4);
14 for (unsigned int offset = 0; offset < swizzle.size(); ++offset) {
15 fSwizzle[offset] = swizzle[offset];
16 }
17 if (swizzle.size() < 4) {
18 fSwizzle[swizzle.size()] = 0;
19 }
20}
21