aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkSurfaceCharacterization.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/private/SkSurfaceCharacterization.h')
-rw-r--r--include/private/SkSurfaceCharacterization.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h
new file mode 100644
index 0000000000..f3acb01236
--- /dev/null
+++ b/include/private/SkSurfaceCharacterization.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkSurfaceCharacterization_DEFINED
+#define SkSurfaceCharacterization_DEFINED
+
+#include "GrTypes.h"
+
+class SkSurface;
+
+// This class captures all the pertinent data about an SkSurface required
+// to perform cpu-preprocessing for gpu-rendering.
+class SkSurfaceCharacterization {
+public:
+ SkSurfaceCharacterization()
+ : fOrigin(kBottomLeft_GrSurfaceOrigin)
+ , fWidth(0)
+ , fHeight(0)
+ , fConfig(kRGBA_8888_GrPixelConfig)
+ , fSampleCnt(0) {
+ }
+
+ void set(GrSurfaceOrigin origin,
+ int width, int height,
+ GrPixelConfig config,
+ int sampleCnt) {
+ fOrigin = origin;
+ fWidth = width;
+ fHeight = height;
+ fConfig = config;
+ fSampleCnt = sampleCnt;
+ }
+
+ GrSurfaceOrigin origin() const { return fOrigin; }
+ int width() const { return fWidth; }
+ int height() const { return fHeight; }
+ GrPixelConfig config() const { return fConfig; }
+ int sampleCount() const { return fSampleCnt; }
+
+private:
+ GrSurfaceOrigin fOrigin;
+ int fWidth;
+ int fHeight;
+ GrPixelConfig fConfig;
+ int fSampleCnt;
+ // TODO: need to include caps!
+ // Maybe use GrContextThreadSafeProxy (it has the caps & the unique Context ID already)
+};
+
+#endif