Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: src/image/SkImage_BitmapBase.h

Issue 577063004: Refactoring in SkImage implementations backed by a SkBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@small_refactor_skimageCodec
Patch Set: Comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImagePriv.h ('k') | src/image/SkImage_BitmapBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 */
+
« no previous file with comments | « src/image/SkImagePriv.h ('k') | src/image/SkImage_BitmapBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698