1 /*
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 "SkTileGridPicture.h"
9
10 #include "SkPictureStateTree.h"
11 #include "SkTileGrid.h"
12
13
SkTileGridPicture(int tileWidth,int tileHeight,int width,int height)14 SkTileGridPicture::SkTileGridPicture(int tileWidth, int tileHeight, int width, int height) {
15 fTileWidth = tileWidth;
16 fTileHeight = tileHeight;
17 fXTileCount = (width + tileWidth - 1) / tileWidth;
18 fYTileCount = (height + tileHeight - 1) / tileHeight;
19 }
20
createBBoxHierarchy() const21 SkBBoxHierarchy* SkTileGridPicture::createBBoxHierarchy() const {
22 return SkNEW_ARGS(SkTileGrid, (fTileWidth, fTileHeight, fXTileCount, fYTileCount,
23 SkTileGridNextDatum<SkPictureStateTree::Draw>));
24 }
25