OLD | NEW |
(Empty) | |
| 1 |
| 2 /* |
| 3 * Copyright 2016 Google Inc. |
| 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. |
| 7 */ |
| 8 #ifndef RasterWindowContext_android_DEFINED |
| 9 #define RasterWindowContext_android_DEFINED |
| 10 |
| 11 #include <android/native_window_jni.h> |
| 12 |
| 13 #include "../RasterWindowContext.h" |
| 14 |
| 15 namespace sk_app { |
| 16 |
| 17 class RasterWindowContext_android : public RasterWindowContext { |
| 18 public: |
| 19 friend RasterWindowContext* RasterWindowContext::Create( |
| 20 void* platformData, const DisplayParams&); |
| 21 |
| 22 sk_sp<SkSurface> getBackbufferSurface() override; |
| 23 void swapBuffers() override; |
| 24 |
| 25 bool isValid() override { return SkToBool(fNativeWindow); } |
| 26 void resize(uint32_t w, uint32_t h) override { |
| 27 SkDEBUGFAIL("Resize is currently unsupported."); |
| 28 } |
| 29 void setDisplayParams(const DisplayParams& params) override { |
| 30 SkDEBUGFAIL("setDisplayParams is currently unsupported."); |
| 31 } |
| 32 |
| 33 private: |
| 34 RasterWindowContext_android(void* platformData, const DisplayParams& params)
; |
| 35 sk_sp<SkSurface> fBackbufferSurface = nullptr; |
| 36 ANativeWindow* fNativeWindow = nullptr; |
| 37 ANativeWindow_Buffer fBuffer; |
| 38 ARect fBounds; |
| 39 }; |
| 40 |
| 41 } // namespace sk_app |
| 42 |
| 43 #endif |
OLD | NEW |