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

Unified Diff: tools/viewer/sk_app/WindowContext.h

Issue 1978573003: Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Android stuff Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: tools/viewer/sk_app/WindowContext.h
diff --git a/tools/viewer/sk_app/WindowContext.h b/tools/viewer/sk_app/WindowContext.h
index d48e38e7466949b07031a3dd2443231f3011e847..4ed1f119ea403749e1bed716aa24602d5a0d515e 100644
--- a/tools/viewer/sk_app/WindowContext.h
+++ b/tools/viewer/sk_app/WindowContext.h
@@ -9,22 +9,25 @@
#include "DisplayParams.h"
#include "GrTypes.h"
+#include "SkRefCnt.h"
+#include "SkSurfaceProps.h"
+class GrContext;
class SkSurface;
namespace sk_app {
-// TODO: fill this out with an interface
class WindowContext {
public:
+ WindowContext() : fContext(nullptr)
+ , fSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType) {}
+
virtual ~WindowContext() {}
- virtual SkSurface* getBackbufferSurface() = 0;
+ virtual sk_sp<SkSurface> getBackbufferSurface() = 0;
virtual void swapBuffers() = 0;
- virtual bool makeCurrent() = 0;
-
virtual bool isValid() = 0;
virtual void resize(uint32_t w, uint32_t h) = 0;
@@ -33,6 +36,13 @@ public:
virtual void setDisplayParams(const DisplayParams& params) = 0;
virtual GrBackendContext getBackendContext() = 0;
+
+protected:
+ GrContext* fContext;
+
+ DisplayParams fDisplayParams;
+ GrPixelConfig fPixelConfig;
+ SkSurfaceProps fSurfaceProps;
};
} // namespace sk_app

Powered by Google App Engine
This is Rietveld 408576698