Chromium Code Reviews| Index: tools/viewer/sk_app/unix/RasterWindowContext_unix.h |
| diff --git a/tools/viewer/sk_app/android/RasterWindowContext_android.h b/tools/viewer/sk_app/unix/RasterWindowContext_unix.h |
| similarity index 54% |
| copy from tools/viewer/sk_app/android/RasterWindowContext_android.h |
| copy to tools/viewer/sk_app/unix/RasterWindowContext_unix.h |
| index 7bb24ba30b6352500b8a683fa25c898c0d398fae..bbad020b50de9c1732c6707c2957f88daaad080c 100644 |
| --- a/tools/viewer/sk_app/android/RasterWindowContext_android.h |
| +++ b/tools/viewer/sk_app/unix/RasterWindowContext_unix.h |
| @@ -1,4 +1,3 @@ |
| - |
| /* |
| * Copyright 2016 Google Inc. |
| * |
| @@ -8,31 +7,31 @@ |
| #ifndef RasterWindowContext_android_DEFINED |
| #define RasterWindowContext_android_DEFINED |
| -#include <android/native_window_jni.h> |
| #include "../RasterWindowContext.h" |
| +#include <X11/Xlib.h> |
| namespace sk_app { |
| -class RasterWindowContext_android : public RasterWindowContext { |
| +class RasterWindowContext_unix : public RasterWindowContext { |
| public: |
| - friend RasterWindowContext* RasterWindowContext::Create( |
| - void* platformData, const DisplayParams&); |
| + static RasterWindowContext* Create(Display*, ::Window, const DisplayParams&); |
|
jvanverth1
2016/07/19 21:18:11
If you include Window_unix.h, I typedef Window as
bsalomon
2016/07/25 19:55:53
Done.
|
| sk_sp<SkSurface> getBackbufferSurface() override; |
| void swapBuffers() override; |
| - bool isValid() override { return SkToBool(fNativeWindow); } |
| + bool isValid() override { return SkToBool(fWindow); } |
| void resize(uint32_t w, uint32_t h) override; |
| void setDisplayParams(const DisplayParams& params) override; |
| private: |
| - RasterWindowContext_android(void* platformData, const DisplayParams& params); |
| - void setBuffersGeometry(); |
| + RasterWindowContext_unix(Display*, ::Window, const DisplayParams&); |
| + |
| sk_sp<SkSurface> fBackbufferSurface = nullptr; |
| - ANativeWindow* fNativeWindow = nullptr; |
| - ANativeWindow_Buffer fBuffer; |
| - ARect fBounds; |
| + |
| + Display* fDisplay; |
| + ::Window fWindow; |
| + GC fGC; |
| }; |
| } // namespace sk_app |