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

Side by Side Diff: tools/viewer/sk_app/android/RasterWindowContext_android.h

Issue 2050613003: Support resize in Android Viewer App (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nits Created 4 years, 6 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 1
2 /* 2 /*
3 * Copyright 2016 Google Inc. 3 * Copyright 2016 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef RasterWindowContext_android_DEFINED 8 #ifndef RasterWindowContext_android_DEFINED
9 #define RasterWindowContext_android_DEFINED 9 #define RasterWindowContext_android_DEFINED
10 10
11 #include <android/native_window_jni.h> 11 #include <android/native_window_jni.h>
12 12
13 #include "../RasterWindowContext.h" 13 #include "../RasterWindowContext.h"
14 14
15 namespace sk_app { 15 namespace sk_app {
16 16
17 class RasterWindowContext_android : public RasterWindowContext { 17 class RasterWindowContext_android : public RasterWindowContext {
18 public: 18 public:
19 friend RasterWindowContext* RasterWindowContext::Create( 19 friend RasterWindowContext* RasterWindowContext::Create(
20 void* platformData, const DisplayParams&); 20 void* platformData, const DisplayParams&);
21 21
22 sk_sp<SkSurface> getBackbufferSurface() override; 22 sk_sp<SkSurface> getBackbufferSurface() override;
23 void swapBuffers() override; 23 void swapBuffers() override;
24 24
25 bool isValid() override { return SkToBool(fNativeWindow); } 25 bool isValid() override { return SkToBool(fNativeWindow); }
26 void resize(uint32_t w, uint32_t h) override { 26 void resize(uint32_t w, uint32_t h) override;
27 SkDEBUGFAIL("Resize is currently unsupported."); 27 void setDisplayParams(const DisplayParams& params) override;
28 }
29 void setDisplayParams(const DisplayParams& params) override {
30 SkDEBUGFAIL("setDisplayParams is currently unsupported.");
31 }
32 28
33 private: 29 private:
34 RasterWindowContext_android(void* platformData, const DisplayParams& params) ; 30 RasterWindowContext_android(void* platformData, const DisplayParams& params) ;
31 void setBuffersGeometry();
35 sk_sp<SkSurface> fBackbufferSurface = nullptr; 32 sk_sp<SkSurface> fBackbufferSurface = nullptr;
36 ANativeWindow* fNativeWindow = nullptr; 33 ANativeWindow* fNativeWindow = nullptr;
37 ANativeWindow_Buffer fBuffer; 34 ANativeWindow_Buffer fBuffer;
38 ARect fBounds; 35 ARect fBounds;
39 }; 36 };
40 37
41 } // namespace sk_app 38 } // namespace sk_app
42 39
43 #endif 40 #endif
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/android/GLWindowContext_android.cpp ('k') | tools/viewer/sk_app/android/RasterWindowContext_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698