aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-12-08 10:21:31 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-08 17:16:00 +0000
commitc465d13e6fca5e171bde45d35b2dd43117f4702e (patch)
tree588b2b31ffba95ed8eecb5327cb4335f35c8c1bd /samplecode
parent4bcef3c40ad8d3a16bbca4ab74fa15256fb4b125 (diff)
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>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterQuality.cpp2
-rw-r--r--samplecode/SampleIdentityScale.cpp2
-rw-r--r--samplecode/SampleLayers.cpp2
-rw-r--r--samplecode/SampleLua.cpp6
-rwxr-xr-xsamplecode/SampleShadowReference.cpp2
-rw-r--r--samplecode/SampleShip.cpp4
-rw-r--r--samplecode/SampleSubpixelTranslate.cpp2
-rw-r--r--samplecode/SampleUnpremul.cpp2
8 files changed, 11 insertions, 11 deletions
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index a68fa173fc..d7edbd3e90 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -28,7 +28,7 @@ static sk_sp<SkSurface> make_surface(SkCanvas* canvas, const SkImageInfo& info)
}
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 6bf948daed..2ec9112800 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -80,5 +80,5 @@ private:
//////////////////////////////////////////////////////////////////////////////
-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 36ed2ab666..37dae888f9 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -213,7 +213,7 @@ public:
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 99c5525b85..848a942e00 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -18,8 +18,8 @@ extern "C" {
#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 @@ public:
~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 ef63fc5b4e..b3d462df62 100755
--- a/samplecode/SampleShadowReference.cpp
+++ b/samplecode/SampleShadowReference.cpp
@@ -35,7 +35,7 @@ public:
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 3abfaf7f05..de650af03f 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -48,10 +48,10 @@ static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xfo
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 79500037be..51b5ef6631 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -108,5 +108,5 @@ private:
//////////////////////////////////////////////////////////////////////////////
-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 57f0efc669..108d70914f 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -176,6 +176,6 @@ private:
//////////////////////////////////////////////////////////////////////////////
static SkView* MyFactory() {
- return new UnpremulView(GetResourcePath());
+ return new UnpremulView(GetResourcePath("images"));
}
static SkViewRegister reg(MyFactory);