Chromium Code Reviews| 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 "../WindowContext.h" | |
| 14 | |
| 15 namespace sk_app { | |
| 16 | |
| 17 class RasterWindowContext_android : public WindowContext { | |
| 18 public: | |
| 19 RasterWindowContext_android(void* platformData, const DisplayParams& params) ; | |
| 20 sk_sp<SkSurface> getBackbufferSurface() override; | |
| 21 void swapBuffers() override; | |
| 22 | |
| 23 bool isValid() override { return true; } | |
|
djsollen
2016/06/07 19:31:48
should only return true if fNativeWindow != nullpt
liyuqian
2016/06/07 19:53:02
Done.
| |
| 24 void resize(uint32_t w, uint32_t h) override { | |
|
djsollen
2016/06/07 19:31:48
implement this because I may want to try to use th
liyuqian
2016/06/07 19:53:02
In the next CL.
| |
| 25 SkDEBUGFAIL("Resize is currently unsupported."); | |
| 26 } | |
| 27 void setDisplayParams(const DisplayParams& params) override { | |
| 28 SkDEBUGFAIL("setDisplayParams is currently unsupported."); | |
| 29 } | |
| 30 | |
| 31 // Explicitly convert nullptr to GrBackendContext is needed for compiling | |
| 32 GrBackendContext getBackendContext() override { return (GrBackendContext) nu llptr; } | |
|
djsollen
2016/06/07 19:31:48
put in common RasterWindowContext.h
liyuqian
2016/06/07 19:53:02
Done.
| |
| 33 | |
| 34 protected: | |
|
djsollen
2016/06/07 19:31:48
put in common RasterWindowContext.h
liyuqian
2016/06/07 19:53:02
Done.
| |
| 35 bool isGpuContext() override { return false; } | |
| 36 | |
| 37 private: | |
| 38 sk_sp<SkSurface> fBackbufferSurface = nullptr; | |
| 39 ANativeWindow* fNativeWindow = nullptr; | |
| 40 ANativeWindow_Buffer fBuffer; | |
| 41 ARect fBounds; | |
| 42 }; | |
| 43 | |
| 44 } // namespace sk_app | |
| 45 | |
| 46 #endif | |
| OLD | NEW |