180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/*
380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2011 Google Inc.
480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru *
580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be
680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file.
780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */
880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkOpArray.h"
980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste QueruSkOpArray::SkOpArray() : fType(SkOperand2::kNoType) {
1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}
1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste QueruSkOpArray::SkOpArray(SkOperand2::OpType type) : fType(type) {
1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}
1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querubool SkOpArray::getIndex(int index, SkOperand2* operand) {
1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    if (index >= count()) {
1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        SkASSERT(0);
1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        return false;
2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    }
2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    *operand = begin()[index];
2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    return true;
2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}
24