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

Unified Diff: include/gpu/GrTypesPriv.h

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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 | « include/gpu/GrProcessorUnitTest.h ('k') | include/gpu/effects/GrConstColorProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypesPriv.h
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index 6a6fd54c7ba5488b2bbfd19eb7c9a3350fe93a41..8c7d6bda65150b6cd055a235f136077f4897c008 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -10,6 +10,7 @@
#include "GrTypes.h"
#include "SkRect.h"
+#include "SkRefCnt.h"
/**
* Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars,
@@ -476,4 +477,9 @@ enum class GrBackendObjectOwnership : bool {
kOwned = true
};
+template <typename T> T * const * sk_sp_address_as_pointer_address(sk_sp<T> const * sp) {
+ static_assert(sizeof(T*) == sizeof(sk_sp<T>), "sk_sp not expected size.");
+ return reinterpret_cast<T * const *>(sp);
+}
+
#endif
« no previous file with comments | « include/gpu/GrProcessorUnitTest.h ('k') | include/gpu/effects/GrConstColorProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698