diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-14 14:15:28 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-14 14:15:28 +0000 |
commit | 1d5bbb26cfe1c1d195c9525b42ff1bb7a49196b8 (patch) | |
tree | 85f767b0de37b63f69a0eddc7e024e1276fce348 | |
parent | 5e00989a283111cef05bed8102e45c16651e43e4 (diff) |
Spin off incidental changes from DM CL (22839016).
BUG=
R=epoger@google.com, bsalomon@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/27023004
git-svn-id: http://skia.googlecode.com/svn/trunk@11752 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gm/gm_expectations.cpp | 4 | ||||
-rw-r--r-- | gm/gm_expectations.h | 20 | ||||
-rw-r--r-- | gm/texdata.cpp | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/gm/gm_expectations.cpp b/gm/gm_expectations.cpp index 63aa638aac..828e9f8b97 100644 --- a/gm/gm_expectations.cpp +++ b/gm/gm_expectations.cpp @@ -203,7 +203,7 @@ namespace skiagm { // IndividualImageExpectationsSource class... - Expectations IndividualImageExpectationsSource::get(const char *testName) { + Expectations IndividualImageExpectationsSource::get(const char *testName) const { SkString path = SkOSPath::SkPathJoin(fRootDir.c_str(), testName); SkBitmap referenceBitmap; bool decodedReferenceBitmap = @@ -226,7 +226,7 @@ namespace skiagm { fJsonExpectedResults = fJsonRoot[kJsonKey_ExpectedResults]; } - Expectations JsonExpectationsSource::get(const char *testName) { + Expectations JsonExpectationsSource::get(const char *testName) const { return Expectations(fJsonExpectedResults[testName]); } diff --git a/gm/gm_expectations.h b/gm/gm_expectations.h index de8958975b..401af0dab5 100644 --- a/gm/gm_expectations.h +++ b/gm/gm_expectations.h @@ -49,14 +49,14 @@ namespace skiagm { /** * Create a ResultDigest representing an actual image result. */ - GmResultDigest(const SkBitmap &bitmap); + explicit GmResultDigest(const SkBitmap &bitmap); /** * Create a ResultDigest representing an allowed result * checksum within JSON expectations file, in the form * ["bitmap-64bitMD5", 12345]. */ - GmResultDigest(const Json::Value &jsonTypeValuePair); + explicit GmResultDigest(const Json::Value &jsonTypeValuePair); /** * Returns true if this GmResultDigest was fully and successfully @@ -96,7 +96,7 @@ namespace skiagm { */ class BitmapAndDigest { public: - BitmapAndDigest(const SkBitmap &bitmap) : fBitmap(bitmap), fDigest(bitmap) {} + explicit BitmapAndDigest(const SkBitmap &bitmap) : fBitmap(bitmap), fDigest(bitmap) {} const SkBitmap fBitmap; const GmResultDigest fDigest; @@ -110,7 +110,7 @@ namespace skiagm { /** * No expectations at all. */ - Expectations(bool ignoreFailure=kDefaultIgnoreFailure); + explicit Expectations(bool ignoreFailure=kDefaultIgnoreFailure); /** * Expect exactly one image (appropriate for the case when we @@ -125,7 +125,7 @@ namespace skiagm { * It's fine if the jsonElement is null or empty; in that case, we just * don't have any expectations. */ - Expectations(Json::Value jsonElement); + explicit Expectations(Json::Value jsonElement); /** * Returns true iff we want to ignore failed expectations. @@ -179,7 +179,7 @@ namespace skiagm { public: SK_DECLARE_INST_COUNT(ExpectationsSource) - virtual Expectations get(const char *testName) = 0; + virtual Expectations get(const char *testName) const = 0; private: typedef SkRefCnt INHERITED; @@ -197,9 +197,9 @@ namespace skiagm { * rootDir: directory under which to look for image files * (this string will be copied to storage within this object) */ - IndividualImageExpectationsSource(const char *rootDir) : fRootDir(rootDir) {} + explicit IndividualImageExpectationsSource(const char *rootDir) : fRootDir(rootDir) {} - Expectations get(const char *testName) SK_OVERRIDE ; + Expectations get(const char *testName) const SK_OVERRIDE ; private: const SkString fRootDir; @@ -216,9 +216,9 @@ namespace skiagm { * * jsonPath: path to JSON file to read */ - JsonExpectationsSource(const char *jsonPath); + explicit JsonExpectationsSource(const char *jsonPath); - Expectations get(const char *testName) SK_OVERRIDE; + Expectations get(const char *testName) const SK_OVERRIDE; private: diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 8ba0c7741c..645ced1e67 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -35,6 +35,8 @@ protected: return make_isize(2*S, 2*S); } + virtual uint32_t onGetFlags() const SK_OVERRIDE { return kGPUOnly_Flag; } + virtual void onDraw(SkCanvas* canvas) { SkBaseDevice* device = canvas->getTopDevice(); GrRenderTarget* target = device->accessRenderTarget(); |