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

Side by Side Diff: tools/viewer/sk_app/unix/RasterWindowContext_unix.h

Issue 2165813002: Add sw support to viewer on Linux. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: minor Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1
2 /* 1 /*
3 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 #ifndef RasterWindowContext_android_DEFINED 7 #ifndef RasterWindowContext_android_DEFINED
9 #define RasterWindowContext_android_DEFINED 8 #define RasterWindowContext_android_DEFINED
10 9
11 #include <android/native_window_jni.h>
12 10
13 #include "../RasterWindowContext.h" 11 #include "../RasterWindowContext.h"
12 #include <X11/Xlib.h>
14 13
15 namespace sk_app { 14 namespace sk_app {
16 15
17 class RasterWindowContext_android : public RasterWindowContext { 16 class RasterWindowContext_unix : public RasterWindowContext {
18 public: 17 public:
19 friend RasterWindowContext* RasterWindowContext::Create( 18 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.
20 void* platformData, const DisplayParams&);
21 19
22 sk_sp<SkSurface> getBackbufferSurface() override; 20 sk_sp<SkSurface> getBackbufferSurface() override;
23 void swapBuffers() override; 21 void swapBuffers() override;
24 22
25 bool isValid() override { return SkToBool(fNativeWindow); } 23 bool isValid() override { return SkToBool(fWindow); }
26 void resize(uint32_t w, uint32_t h) override; 24 void resize(uint32_t w, uint32_t h) override;
27 void setDisplayParams(const DisplayParams& params) override; 25 void setDisplayParams(const DisplayParams& params) override;
28 26
29 private: 27 private:
30 RasterWindowContext_android(void* platformData, const DisplayParams& params) ; 28 RasterWindowContext_unix(Display*, ::Window, const DisplayParams&);
31 void setBuffersGeometry(); 29
32 sk_sp<SkSurface> fBackbufferSurface = nullptr; 30 sk_sp<SkSurface> fBackbufferSurface = nullptr;
33 ANativeWindow* fNativeWindow = nullptr; 31
34 ANativeWindow_Buffer fBuffer; 32 Display* fDisplay;
35 ARect fBounds; 33 ::Window fWindow;
34 GC fGC;
36 }; 35 };
37 36
38 } // namespace sk_app 37 } // namespace sk_app
39 38
40 #endif 39 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698