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

Unified Diff: gm/image.cpp

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove unnecessary changes. Created 7 years, 7 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 | « gm/gmmain.cpp ('k') | gyp/tests.gyp » ('j') | include/core/SkOSFile.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image.cpp
diff --git a/gm/image.cpp b/gm/image.cpp
index 8578e510bad28478a911ef2606d04d96037df010..55b4cdbc8a7df5a576bbaa8d9fe4ecb338a5e135 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -8,8 +8,9 @@
#include "gm.h"
#include "SkSurface.h"
#include "SkCanvas.h"
-#include "SkStream.h"
#include "SkData.h"
+#include "SkOSFile.h"
+#include "SkStream.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
@@ -30,8 +31,8 @@ static SkData* fileToData(const char path[]) {
return SkData::NewFromMalloc(mem, size);
}
-static void drawJpeg(SkCanvas* canvas, const SkISize& size) {
- SkAutoDataUnref data(fileToData("/Users/mike/Downloads/skia.google.jpeg"));
+static void drawJpeg(SkString filename, SkCanvas* canvas, const SkISize& size) {
+ SkAutoDataUnref data(fileToData(filename.c_str()));
SkImage* image = SkImage::NewEncodedData(data);
if (image) {
SkAutoCanvasRestore acr(canvas, true);
@@ -123,7 +124,9 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) {
- drawJpeg(canvas, this->getISize());
+ SkString filename = SkOSPathUtils::SkPathJoin(
+ INHERITED::gResourcePath.c_str(), "CMYK.jpg");
scroggo 2013/05/24 16:23:37 Changing this file will require a rebaseline (assu
epoger 2013/05/24 16:42:55 I think your best bet is to leave this change out
scroggo 2013/05/24 17:36:05 Done.
+ drawJpeg(filename, canvas, this->getISize());
canvas->scale(2, 2);
« no previous file with comments | « gm/gmmain.cpp ('k') | gyp/tests.gyp » ('j') | include/core/SkOSFile.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698