aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/Resources.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Resources.h')
-rw-r--r--tools/Resources.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/Resources.h b/tools/Resources.h
index 01eaa3f214..7d5909371b 100644
--- a/tools/Resources.h
+++ b/tools/Resources.h
@@ -8,22 +8,32 @@
#ifndef Resources_DEFINED
#define Resources_DEFINED
-#include "SkRefCnt.h"
+#include "SkImage.h"
#include "SkString.h"
class SkBitmap;
class SkData;
-class SkImage;
class SkStreamAsset;
class SkTypeface;
SkString GetResourcePath(const char* resource = "");
+
void SetResourcePath(const char* );
-bool GetResourceAsBitmap(const char* resource, SkBitmap* dst);
-sk_sp<SkImage> GetResourceAsImage(const char* resource);
-std::unique_ptr<SkStreamAsset> GetResourceAsStream(const char* resource);
+bool DecodeDataToBitmap(sk_sp<SkData> data, SkBitmap* dst);
+
sk_sp<SkData> GetResourceAsData(const char* resource);
+
+inline bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
+ return DecodeDataToBitmap(GetResourceAsData(resource), dst);
+}
+
+inline sk_sp<SkImage> GetResourceAsImage(const char* resource) {
+ return SkImage::MakeFromEncoded(GetResourceAsData(resource));
+}
+
+std::unique_ptr<SkStreamAsset> GetResourceAsStream(const char* resource);
+
sk_sp<SkTypeface> MakeResourceAsTypeface(const char* resource);
#endif // Resources_DEFINED