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

Unified Diff: dm/DMSrcSinkAndroid.h

Issue 943393002: Add HWUI Sink to DM on Android Framework builds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary SkStringPrintf() calls Created 5 years, 10 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 | « dm/DM.cpp ('k') | dm/DMSrcSinkAndroid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSinkAndroid.h
diff --git a/dm/DMSrcSinkAndroid.h b/dm/DMSrcSinkAndroid.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c5fe71f18c635f633ac3d01b746dec1b5431868
--- /dev/null
+++ b/dm/DMSrcSinkAndroid.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef DMSrcSinkAndroid_DEFINED
+#define DMSrcSinkAndroid_DEFINED
+
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+
+#include "DMSrcSink.h"
+
+namespace DM {
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+class HWUISink : public Sink {
+public:
+ HWUISink() { }
+
+ Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const SK_OVERRIDE;
+ int enclave() const SK_OVERRIDE { return kGPU_Enclave; }
+ const char* fileExtension() const SK_OVERRIDE { return "png"; }
+
+private:
+ const float kDensity = 1.0f;
+ inline float dp(int x) const { return x * kDensity; }
+};
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+} // namespace DM
+
+#endif // SK_BUILD_FOR_ANDROID_FRAMEWORK
+
+#endif // DMSrcSinkAndroid_DEFINED
« no previous file with comments | « dm/DM.cpp ('k') | dm/DMSrcSinkAndroid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698