blob: 9ae13de4aed7c0a3ef20fb9c6f648ec2fd04ceb2 [file] [log] [blame]
reed@google.com58b21ec2012-07-30 18:20:12 +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#ifndef SkImage_Base_DEFINED
9#define SkImage_Base_DEFINED
10
11#include "SkImage.h"
12
13class SkImage_Base : public SkImage {
14public:
15 SkImage_Base(int width, int height) : INHERITED(width, height) {}
16
robertphillips@google.com97b6b072012-10-31 14:48:39 +000017 virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0;
junov@chromium.orgda904742013-05-01 22:38:16 +000018 virtual GrTexture* onGetTexture() { return NULL; }
skia.committer@gmail.com3e50e992013-05-21 07:01:40 +000019
reed@google.com4b0757b2013-05-20 16:33:41 +000020 // return a read-only copy of the pixels. We promise to not modify them,
21 // but only inspect them (or encode them).
22 virtual bool getROPixels(SkBitmap*) const { return false; }
reed@google.com58b21ec2012-07-30 18:20:12 +000023
rmistry@google.comfbfcd562012-08-23 18:09:54 +000024private:
reed@google.com58b21ec2012-07-30 18:20:12 +000025 typedef SkImage INHERITED;
26};
27
28#endif