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

Unified Diff: src/core/SkBitmapController.h

Issue 1153123003: refactor bitmapshader to use a controller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
Index: src/core/SkBitmapController.h
diff --git a/src/core/SkBitmapController.h b/src/core/SkBitmapController.h
new file mode 100644
index 0000000000000000000000000000000000000000..fbc8851be18afded1947c66a67fceb4ec0887d70
--- /dev/null
+++ b/src/core/SkBitmapController.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkBitmapController_DEFINED
+#define SkBitmapController_DEFINED
+
+#include "SkFilterQuality.h"
+
+class SkBitmap;
+class SkMatrix;
+
+/**
+ * Handles request to scale, filter, and lock a bitmap to be rasterized.
+ */
+class SkBitmapController {
+public:
+ bool requestBitmap(const SkBitmap& inBM, const SkMatrix& inverse, SkFilterQuality inQuality,
+ SkBitmap* outBM, SkMatrix* outInv, SkFilterQuality* outQuality);
scroggo 2015/06/02 13:24:54 Maybe add a comment - it looks like all of these m
reed1 2015/06/02 14:07:46 New version is simpler/clearer.
+
+protected:
+ virtual bool onRequestBitmap(const SkBitmap& inBM, const SkMatrix& inverse, SkFilterQuality inQ,
+ SkBitmap* outBM, SkMatrix* outInv, SkFilterQuality* outQ) = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SkDefaultBitmapController : public SkBitmapController {
+public:
+ SkDefaultBitmapController() {}
+
+protected:
+ bool onRequestBitmap(const SkBitmap&, const SkMatrix&, SkFilterQuality,
+ SkBitmap*, SkMatrix*, SkFilterQuality*) override;
+};
+
+#endif
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkBitmapController.cpp » ('j') | src/core/SkBitmapController.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698