aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTileGridPicture.cpp
blob: 212e3b624345977f2870dbc763c583d15017347c (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 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "SkTileGridPicture.h"

#include "SkPictureStateTree.h"
#include "SkTileGrid.h"


SkTileGridPicture::SkTileGridPicture(int tileWidth, int tileHeight, int width, int height) {
    fTileWidth = tileWidth;
    fTileHeight = tileHeight;
    fXTileCount = (width + tileWidth - 1) / tileWidth;
    fYTileCount = (height + tileHeight - 1) / tileHeight;
}

SkBBoxHierarchy* SkTileGridPicture::createBBoxHierarchy() const {
    return SkNEW_ARGS(SkTileGrid, (fTileWidth, fTileHeight, fXTileCount, fYTileCount,
        SkTileGridNextDatum<SkPictureStateTree::Draw>));
}