2 * Copyright 2015 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef DMSrcSinkAndroid_DEFINED
9 #define DMSrcSinkAndroid_DEFINED
11 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
13 #include "DMSrcSink.h"
17 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
19 // Draws to the Android Framework's HWUI API.
21 class HWUISink : public Sink {
25 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const SK_OVERRIDE;
26 int enclave() const SK_OVERRIDE { return kGPU_Enclave; }
27 const char* fileExtension() const SK_OVERRIDE { return "png"; }
30 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
32 // Trims draw commands to only include those supported by the Android Framework's HWUI API.
34 class ViaAndroidSDK : public Sink {
36 explicit ViaAndroidSDK(Sink*);
38 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const SK_OVERRIDE;
39 int enclave() const SK_OVERRIDE { return fSink->enclave(); }
40 const char* fileExtension() const SK_OVERRIDE { return fSink->fileExtension(); }
43 SkAutoTDelete<Sink> fSink;
46 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
50 #endif // SK_BUILD_FOR_ANDROID_FRAMEWORK
52 #endif // DMSrcSinkAndroid_DEFINED