Index: src/image/SkImage_BitmapBase.h |
diff --git a/src/image/SkImage_BitmapBase.h b/src/image/SkImage_BitmapBase.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cd388b05b2d280bc4ec1a72f8483c4eda21c5043 |
--- /dev/null |
+++ b/src/image/SkImage_BitmapBase.h |
@@ -0,0 +1,39 @@ |
+/* |
+ * Copyright 2014 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkImage_BitmapBase_DEFINED |
+#define SkImage_BitmapBase_DEFINED |
+ |
+#include "SkImage_Base.h" |
+ |
+class SkImage_BitmapBase : public SkImage_Base { |
+public: |
+ SkImage_BitmapBase(int width, int height); |
+ SkImage_BitmapBase(const SkBitmap&); |
+ virtual ~SkImage_BitmapBase() {} |
+ |
+ virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const SK_OVERRIDE; |
+ virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, const SkRect& dst, |
+ const SkPaint*) const SK_OVERRIDE; |
+ |
+ virtual SkShader* onNewShader(SkShader::TileMode, |
+ SkShader::TileMode, |
+ const SkMatrix* localMatrix) const SK_OVERRIDE; |
+ |
+ virtual bool isOpaque() const SK_OVERRIDE; |
+ |
+protected: |
+ virtual const SkBitmap& getBitmap() const { return fBitmap; }; |
+ |
+private: |
+ SkBitmap fBitmap; |
+ |
+ typedef SkImage_Base INHERITED; |
+}; |
+ |
+#endif /* SkImage_BitmapBase_DEFINED */ |
+ |