reed@google.com | 58b21ec | 2012-07-30 18:20:12 +0000 | [diff] [blame] | 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 | #ifndef SkImage_Base_DEFINED |
| 9 | #define SkImage_Base_DEFINED |
| 10 | |
| 11 | #include "SkImage.h" |
| 12 | |
| 13 | class SkImage_Base : public SkImage { |
| 14 | public: |
| 15 | SkImage_Base(int width, int height) : INHERITED(width, height) {} |
| 16 | |
robertphillips@google.com | 97b6b07 | 2012-10-31 14:48:39 +0000 | [diff] [blame] | 17 | virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0; |
junov@chromium.org | da90474 | 2013-05-01 22:38:16 +0000 | [diff] [blame] | 18 | virtual GrTexture* onGetTexture() { return NULL; } |
skia.committer@gmail.com | 3e50e99 | 2013-05-21 07:01:40 +0000 | [diff] [blame^] | 19 | |
reed@google.com | 4b0757b | 2013-05-20 16:33:41 +0000 | [diff] [blame] | 20 | // 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.com | 58b21ec | 2012-07-30 18:20:12 +0000 | [diff] [blame] | 23 | |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 24 | private: |
reed@google.com | 58b21ec | 2012-07-30 18:20:12 +0000 | [diff] [blame] | 25 | typedef SkImage INHERITED; |
| 26 | }; |
| 27 | |
| 28 | #endif |