aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-12-01 10:52:28 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-01 17:12:49 +0000
commit8ceee43de49b314fff58852c2d89ed3885ae71ee (patch)
treec3046b938bd7c026c84f164b785f749472629f80 /samplecode
parent3ac99cfaa2d434c71d9c82fc234fadd55fe96394 (diff)
Remove more views code, just to simplify things
Bug: skia: Change-Id: Ie31a3c764e4f88f2b08f4198bd253841a2d8c264 Reviewed-on: https://skia-review.googlesource.com/79100 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleAAGeometry.cpp1
-rw-r--r--samplecode/SampleArc.cpp17
-rw-r--r--samplecode/SampleCamera.cpp3
-rw-r--r--samplecode/SampleCode.cpp5
-rw-r--r--samplecode/SampleFilter2.cpp7
-rw-r--r--samplecode/SampleMegaStroke.cpp4
-rw-r--r--samplecode/SamplePolyToPoly.cpp1
-rw-r--r--samplecode/SampleXfer.cpp1
8 files changed, 22 insertions, 17 deletions
diff --git a/samplecode/SampleAAGeometry.cpp b/samplecode/SampleAAGeometry.cpp
index 3d5426e637..75657a1883 100644
--- a/samplecode/SampleAAGeometry.cpp
+++ b/samplecode/SampleAAGeometry.cpp
@@ -14,6 +14,7 @@
// #include "SkPathOpsSimplifyAA.h"
// #include "SkPathStroker.h"
#include "SkPointPriv.h"
+#include "SkString.h"
#include "SkView.h"
#if 0
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 2073060645..b3b1cfefaf 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -7,22 +7,23 @@
#include "SampleCode.h"
#include "SkAnimTimer.h"
-#include "SkView.h"
#include "SkCanvas.h"
+#include "SkColorFilter.h"
+#include "SkColorPriv.h"
+#include "SkCornerPathEffect.h"
#include "SkDrawable.h"
#include "SkGradientShader.h"
+#include "SkLayerRasterizer.h"
#include "SkPath.h"
+#include "SkPathMeasure.h"
+#include "SkPictureRecorder.h"
+#include "SkRandom.h"
#include "SkRegion.h"
#include "SkShader.h"
+#include "SkString.h"
#include "SkUtils.h"
+#include "SkView.h"
#include "Sk1DPathEffect.h"
-#include "SkCornerPathEffect.h"
-#include "SkPathMeasure.h"
-#include "SkPictureRecorder.h"
-#include "SkRandom.h"
-#include "SkColorPriv.h"
-#include "SkColorFilter.h"
-#include "SkLayerRasterizer.h"
#include "SkParsePath.h"
static void testparse() {
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
index 85b854eced..fdba40375a 100644
--- a/samplecode/SampleCamera.cpp
+++ b/samplecode/SampleCamera.cpp
@@ -14,10 +14,11 @@
#include "SkEmbossMaskFilter.h"
#include "SkGradientShader.h"
#include "SkPath.h"
+#include "SkRandom.h"
#include "SkRegion.h"
#include "SkShader.h"
+#include "SkString.h"
#include "SkUtils.h"
-#include "SkRandom.h"
class CameraView : public SampleView {
SkTArray<sk_sp<SkShader>> fShaders;
diff --git a/samplecode/SampleCode.cpp b/samplecode/SampleCode.cpp
index 252ca2a670..62021069ca 100644
--- a/samplecode/SampleCode.cpp
+++ b/samplecode/SampleCode.cpp
@@ -7,6 +7,7 @@
#include "SampleCode.h"
#include "SkCanvas.h"
+#include "SkString.h"
#if SK_SUPPORT_GPU
# include "GrContext.h"
@@ -17,7 +18,7 @@ class GrContext;
//////////////////////////////////////////////////////////////////////////////
bool SampleCode::CharQ(const SkEvent& evt, SkUnichar* outUni) {
- if (evt.isType(gCharEvtName, sizeof(gCharEvtName) - 1)) {
+ if (evt.isType(gCharEvtName)) {
if (outUni) {
*outUni = evt.getFast32();
}
@@ -27,7 +28,7 @@ bool SampleCode::CharQ(const SkEvent& evt, SkUnichar* outUni) {
}
bool SampleCode::TitleQ(const SkEvent& evt) {
- return evt.isType(gTitleEvtName, sizeof(gTitleEvtName) - 1);
+ return evt.isType(gTitleEvtName);
}
void SampleCode::TitleR(SkEvent* evt, const char title[]) {
diff --git a/samplecode/SampleFilter2.cpp b/samplecode/SampleFilter2.cpp
index e6134bdb22..72beb06f4b 100644
--- a/samplecode/SampleFilter2.cpp
+++ b/samplecode/SampleFilter2.cpp
@@ -9,15 +9,16 @@
#include "SampleCode.h"
#include "SkView.h"
#include "SkCanvas.h"
+#include "SkColorFilter.h"
+#include "SkColorPriv.h"
#include "SkGradientShader.h"
#include "SkGraphics.h"
#include "SkPath.h"
#include "SkRegion.h"
#include "SkShader.h"
-#include "SkUtils.h"
-#include "SkColorPriv.h"
-#include "SkColorFilter.h"
+#include "SkString.h"
#include "SkTime.h"
+#include "SkUtils.h"
static const char* gNames[] = {
"/skimages/background_01.png"
diff --git a/samplecode/SampleMegaStroke.cpp b/samplecode/SampleMegaStroke.cpp
index d85915600a..a7c2e544fc 100644
--- a/samplecode/SampleMegaStroke.cpp
+++ b/samplecode/SampleMegaStroke.cpp
@@ -37,9 +37,7 @@ protected:
if (SampleCode::CharQ(*evt, &uni)) {
fClip.set(0, 0, 950, 600);
}
- SkString str;
- evt->getType(&str);
- if (str == SkString("SampleCode_Key_Event")) {
+ if (evt->isType("SampleCode_Key_Event")) {
fClip.set(0, 0, 950, 600);
}
return this->INHERITED::onQuery(evt);
diff --git a/samplecode/SamplePolyToPoly.cpp b/samplecode/SamplePolyToPoly.cpp
index 3cfba5ebdb..dd63a78536 100644
--- a/samplecode/SamplePolyToPoly.cpp
+++ b/samplecode/SamplePolyToPoly.cpp
@@ -10,6 +10,7 @@
#include "SkGraphics.h"
#include "SkPath.h"
#include "SkRandom.h"
+#include "SkString.h"
#include "SkTime.h"
class PolyToPolyView : public SampleView {
diff --git a/samplecode/SampleXfer.cpp b/samplecode/SampleXfer.cpp
index 074613c441..d459274dc9 100644
--- a/samplecode/SampleXfer.cpp
+++ b/samplecode/SampleXfer.cpp
@@ -14,6 +14,7 @@
#include "SkPath.h"
#include "SkRandom.h"
#include "SkRSXform.h"
+#include "SkString.h"
#include "SkSurface.h"
#include "SkGradientShader.h"