aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-01-30 12:37:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-30 12:37:02 -0800
commitc8fcafb3f0d152fb92465451bdb2e4bd3ef37222 (patch)
treeed205c0bdd413c88bec4a59373f64dcc04760cfe /include/views
parent8d17a13a71edb0d8412e4354c428582b74587b79 (diff)
First cut at cleaning up Sergio's example code and moving some common code to SkWindow.
Eventually, this will be moved to be a peer of SampleApp so it is compiled by the bots to avoid future bit rot. Also ignore XCode auto-generated flag in CommandLineFlags, and remove the unused multiple-example part. Review URL: https://codereview.chromium.org/890873003
Diffstat (limited to 'include/views')
-rw-r--r--include/views/SkOSWindow_Android.h5
-rw-r--r--include/views/SkOSWindow_Mac.h5
-rw-r--r--include/views/SkOSWindow_NaCl.h5
-rw-r--r--include/views/SkOSWindow_Unix.h5
-rw-r--r--include/views/SkOSWindow_Win.h5
-rw-r--r--include/views/SkOSWindow_iOS.h5
-rw-r--r--include/views/SkWindow.h16
7 files changed, 16 insertions, 30 deletions
diff --git a/include/views/SkOSWindow_Android.h b/include/views/SkOSWindow_Android.h
index 9b0dcb282e..3b23d29b71 100644
--- a/include/views/SkOSWindow_Android.h
+++ b/include/views/SkOSWindow_Android.h
@@ -20,11 +20,6 @@ public:
kNativeGL_BackEndType,
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info);
void detach() {}
void present() {}
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index 5dea2fc12e..2a15bf5f67 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -26,11 +26,6 @@ public:
#endif
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
void detach();
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
void present();
diff --git a/include/views/SkOSWindow_NaCl.h b/include/views/SkOSWindow_NaCl.h
index 317ef9f7df..26263371d9 100644
--- a/include/views/SkOSWindow_NaCl.h
+++ b/include/views/SkOSWindow_NaCl.h
@@ -20,11 +20,6 @@ public:
kNativeGL_BackEndType,
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
bool attach(SkBackEndTypes /* attachType */, int /* msaaSampleCount */, AttachmentInfo* info) {
info->fSampleCount = 0;
info->fStencilBits = 0;
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index 525123c3d3..8c4d81962a 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -38,11 +38,6 @@ public:
kNativeGL_BackEndType,
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
void detach();
void present();
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index 6b5977ce3f..fe65459f4d 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -37,11 +37,6 @@ public:
#endif // SK_SUPPORT_GPU
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
void detach();
void present();
diff --git a/include/views/SkOSWindow_iOS.h b/include/views/SkOSWindow_iOS.h
index 1984900ded..f386c738f9 100644
--- a/include/views/SkOSWindow_iOS.h
+++ b/include/views/SkOSWindow_iOS.h
@@ -21,11 +21,6 @@ public:
kNativeGL_BackEndType,
};
- struct AttachmentInfo {
- int fSampleCount;
- int fStencilBits;
- };
-
void detach();
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
void present();
diff --git a/include/views/SkWindow.h b/include/views/SkWindow.h
index e18aff3512..76a1aa5947 100644
--- a/include/views/SkWindow.h
+++ b/include/views/SkWindow.h
@@ -25,11 +25,22 @@
class SkSurface;
class SkOSMenu;
+#if SK_SUPPORT_GPU
+struct GrGLInterface;
+class GrContext;
+class GrRenderTarget;
+#endif
+
class SkWindow : public SkView {
public:
SkWindow();
virtual ~SkWindow();
+ struct AttachmentInfo {
+ int fSampleCount;
+ int fStencilBits;
+ };
+
SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; }
void setSurfaceProps(const SkSurfaceProps& props) {
fSurfaceProps = props;
@@ -85,6 +96,11 @@ protected:
virtual bool onGetFocusView(SkView** focus) const;
virtual bool onSetFocusView(SkView* focus);
+#if SK_SUPPORT_GPU
+ GrRenderTarget* renderTarget(const AttachmentInfo& attachmentInfo,
+ const GrGLInterface* , GrContext* grContext);
+#endif
+
private:
SkSurfaceProps fSurfaceProps;
SkColorType fColorType;