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

Unified Diff: src/gpu/GrImageIDTextureAdjuster.h

Issue 1424313010: Separate out natively-texture image/bmp draws from cached-as-texture image/bmp draws (Closed) Base URL: https://skia.googlesource.com/skia.git@const
Patch Set: update Created 5 years, 1 month 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/gpu/GrDrawContext.cpp ('k') | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImageIDTextureAdjuster.h
diff --git a/src/gpu/GrImageIDTextureAdjuster.h b/src/gpu/GrImageIDTextureAdjuster.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c0747a62ce337e516cb285845068f418d89517b
--- /dev/null
+++ b/src/gpu/GrImageIDTextureAdjuster.h
@@ -0,0 +1,48 @@
+/*
+ * 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 GrImageIDTextureAdjuster_DEFINED
+#define GrImageIDTextureAdjuster_DEFINED
+
+#include "GrTextureParamsAdjuster.h"
+
+class SkBitmap;
+class SkImage_Base;
+
+/** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope and unmodified
+ while this object exists. */
+class GrBitmapTextureAdjuster : public GrTextureAdjuster {
+public:
+ explicit GrBitmapTextureAdjuster(const SkBitmap* bmp);
+
+private:
+ void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
+
+ void didCacheCopy(const GrUniqueKey& copyKey) override;
+
+ const SkBitmap* fBmp;
+
+ typedef GrTextureAdjuster INHERITED;
+};
+
+/** Implementation for texture-backed SkImages. The image must stay in scope and unmodified while
+ this object exists. */
+class GrImageTextureAdjuster : public GrTextureAdjuster {
+public:
+ explicit GrImageTextureAdjuster(const SkImage_Base* img);
+
+private:
+ void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
+
+ void didCacheCopy(const GrUniqueKey& copyKey) override;
+
+ const SkImage_Base* fImageBase;
+
+ typedef GrTextureAdjuster INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698