blob: 6a9e1f51f7000947cdfd64f2cbc5ce356b127c88 [file] [log] [blame]
twiz@google.com6cf53032012-06-22 18:55:55 +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 "picture_utils.h"
9#include "SkBitmap.h"
10#include "SkPicture.h"
11#include "SkString.h"
12#include "SkStream.h"
13
14namespace sk_tools {
15
16 void make_filepath(SkString* path, const char* dir, const SkString& name) {
17 size_t len = strlen(dir);
18 path->set(dir);
19 if (0 < len && '/' != dir[len - 1]) {
20 path->append("/");
21 }
22 path->append(name);
23 }
24
25 void setup_bitmap(SkBitmap* bitmap, int width, int height) {
26 bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);
27 bitmap->allocPixels();
28 bitmap->eraseColor(0);
29 }
30
31}