resources: orgainize directory.
Should make it easier to ask just for images.
Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index a68fa17..d7edbd3 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -28,7 +28,7 @@
}
static sk_sp<SkShader> make_shader(const SkRect& bounds) {
- sk_sp<SkImage> image(GetResourceAsImage("mandrill_128.png"));
+ sk_sp<SkImage> image(GetResourceAsImage("images/mandrill_128.png"));
return image ? image->makeShader() : nullptr;
}
diff --git a/samplecode/SampleIdentityScale.cpp b/samplecode/SampleIdentityScale.cpp
index 6bf948d..2ec9112 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -80,5 +80,5 @@
//////////////////////////////////////////////////////////////////////////////
-static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); }
+static SkView* MyFactory() { return new IdentityScaleView("images/mandrill_256.png"); }
static SkViewRegister reg(MyFactory);
diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp
index 36ed2ab..37dae88 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -213,7 +213,7 @@
BackdropView() {
fCenter.set(200, 150);
fAngle = 0;
- fImage = GetResourceAsImage("mandrill_512.png");
+ fImage = GetResourceAsImage("images/mandrill_512.png");
fFilter = SkDilateImageFilter::Make(8, 8, nullptr);
}
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 99c5525..848a942 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -18,8 +18,8 @@
#include "lauxlib.h"
}
-//#define LUA_FILENAME "test.lua"
-#define LUA_FILENAME "slides.lua"
+//#define LUA_FILENAME "lua/test.lua"
+#define LUA_FILENAME "lua/slides.lua"
static const char gDrawName[] = "onDrawContent";
static const char gClickName[] = "onClickHandler";
@@ -44,7 +44,7 @@
~LuaView() override { delete fLua; }
void setImageFilename(lua_State* L) {
- SkString str = GetResourcePath("mandrill_256.png");
+ SkString str = GetResourcePath("images/mandrill_256.png");
lua_getglobal(L, "setImageFilename");
if (lua_isfunction(L, -1)) {
diff --git a/samplecode/SampleShadowReference.cpp b/samplecode/SampleShadowReference.cpp
index ef63fc5..b3d462d 100755
--- a/samplecode/SampleShadowReference.cpp
+++ b/samplecode/SampleShadowReference.cpp
@@ -35,7 +35,7 @@
protected:
void onOnceBeforeDraw() override {
fRRectPath.addRRect(SkRRect::MakeRectXY(SkRect::MakeXYWH(-130, -128.5, 130, 128.5), 4, 4));
- fReferenceImage = GetResourceAsImage("shadowreference.png");
+ fReferenceImage = GetResourceAsImage("images/shadowreference.png");
}
// overrides from SkEventSink
diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp
index 3abfaf7..de650af 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -48,10 +48,10 @@
class DrawShipView : public SampleView {
public:
DrawShipView(const char name[], DrawAtlasProc proc) : fName(name), fProc(proc) {
- fAtlas = GetResourceAsImage("ship.png");
+ fAtlas = GetResourceAsImage("images/ship.png");
if (!fAtlas) {
SkDebugf("\nCould not decode file ship.png. Falling back to penguin mode.\n");
- fAtlas = GetResourceAsImage("baby_tux.png");
+ fAtlas = GetResourceAsImage("images/baby_tux.png");
if (!fAtlas) {
SkDebugf("\nCould not decode file baby_tux.png. Did you forget"
" to set the resourcePath?\n");
diff --git a/samplecode/SampleSubpixelTranslate.cpp b/samplecode/SampleSubpixelTranslate.cpp
index 7950003..51b5ef6 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -108,5 +108,5 @@
//////////////////////////////////////////////////////////////////////////////
-static SkView* MyFactory() { return new SubpixelTranslateView("mandrill_256.png", .05f, .05f); }
+static SkView* MyFactory() { return new SubpixelTranslateView("images/mandrill_256.png", .05f, .05f); }
static SkViewRegister reg(MyFactory);
diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
index 57f0efc..108d709 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -176,6 +176,6 @@
//////////////////////////////////////////////////////////////////////////////
static SkView* MyFactory() {
- return new UnpremulView(GetResourcePath());
+ return new UnpremulView(GetResourcePath("images"));
}
static SkViewRegister reg(MyFactory);