blob: 068a60d2bba8c0f0f3957229d1fe65188b00cd6c [file] [log] [blame]
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001/*
2 * Copyright 2017 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#ifndef TestAtlasTextRenderer_DEFINED
9#define TestAtlasTextRenderer_DEFINED
10
11#include "SkAtlasTextRenderer.h"
12#include "SkBitmap.h"
13
14namespace sk_gpu_test {
15
16class TestContext;
17
18/**
19 * Base class for implementations of SkAtlasTextRenderer in order to test the SkAtlasText APIs.
20 * Adds a helper for creating SkAtlasTextTargets and to read back the contents of a target as a
21 * bitmap.
22 */
23class TestAtlasTextRenderer : public SkAtlasTextRenderer {
24public:
25 /** Returns a handle that can be used to construct a SkAtlasTextTarget instance. */
26 virtual void* makeTargetHandle(int width, int height) = 0;
27
28 /** Makes a SkBitmap of the target handle's contents. */
29 virtual SkBitmap readTargetHandle(void* targetHandle) = 0;
30};
31
32} // namespace sk_gpu_test
33
34#endif