aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_app
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-04-13 14:30:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-16 22:46:50 +0000
commit37c5403890000289d7db9fd1d90cf96c2ee12bf3 (patch)
tree7d85406ae79f02f59f99146b117cdc63cee7c30b /tools/sk_app
parente7fbafe1da930eba9e24f60fefef5a440f715219 (diff)
Add pixel geometry and dft selection to viewer app.
Change-Id: I2fea84793383c44b102fa97b23f59235ef302ff9 Reviewed-on: https://skia-review.googlesource.com/121581 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'tools/sk_app')
-rw-r--r--tools/sk_app/DisplayParams.h9
-rw-r--r--tools/sk_app/GLWindowContext.cpp2
-rw-r--r--tools/sk_app/VulkanWindowContext.cpp2
-rw-r--r--tools/sk_app/Window.h1
-rw-r--r--tools/sk_app/WindowContext.h7
-rw-r--r--tools/sk_app/unix/RasterWindowContext_unix.cpp2
6 files changed, 12 insertions, 11 deletions
diff --git a/tools/sk_app/DisplayParams.h b/tools/sk_app/DisplayParams.h
index 203e8bdeca..54e9135749 100644
--- a/tools/sk_app/DisplayParams.h
+++ b/tools/sk_app/DisplayParams.h
@@ -9,16 +9,23 @@
#include "GrContextOptions.h"
#include "SkImageInfo.h"
+#include "SkSurfaceProps.h"
namespace sk_app {
struct DisplayParams {
- DisplayParams() : fColorType(kN32_SkColorType), fColorSpace(nullptr), fMSAASampleCount(1) {}
+ DisplayParams()
+ : fColorType(kN32_SkColorType)
+ , fColorSpace(nullptr)
+ , fMSAASampleCount(1)
+ , fSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType)
+ {}
SkColorType fColorType;
sk_sp<SkColorSpace> fColorSpace;
int fMSAASampleCount;
GrContextOptions fGrContextOptions;
+ SkSurfaceProps fSurfaceProps;
};
} // namespace sk_app
diff --git a/tools/sk_app/GLWindowContext.cpp b/tools/sk_app/GLWindowContext.cpp
index 9d042cf19e..7dddede9aa 100644
--- a/tools/sk_app/GLWindowContext.cpp
+++ b/tools/sk_app/GLWindowContext.cpp
@@ -74,7 +74,7 @@ sk_sp<SkSurface> GLWindowContext::getBackbufferSurface() {
kBottomLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType,
fDisplayParams.fColorSpace,
- &fSurfaceProps);
+ &fDisplayParams.fSurfaceProps);
}
}
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
index ecf6d80b2c..7021504f2b 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -300,7 +300,7 @@ void VulkanWindowContext::createBuffers(VkFormat format, SkColorType colorType)
kTopLeft_GrSurfaceOrigin,
colorType,
fDisplayParams.fColorSpace,
- &fSurfaceProps);
+ &fDisplayParams.fSurfaceProps);
}
// create the command pool for the command buffers
diff --git a/tools/sk_app/Window.h b/tools/sk_app/Window.h
index 927d8a9677..8a71f3566f 100644
--- a/tools/sk_app/Window.h
+++ b/tools/sk_app/Window.h
@@ -16,6 +16,7 @@
class GrContext;
class SkCanvas;
class SkSurface;
+class SkSurfaceProps;
namespace sk_app {
diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h
index 9a12f2c04b..8b91011828 100644
--- a/tools/sk_app/WindowContext.h
+++ b/tools/sk_app/WindowContext.h
@@ -23,7 +23,6 @@ public:
WindowContext(const DisplayParams& params)
: fContext(nullptr)
, fDisplayParams(params)
- , fSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType)
, fSampleCount(1)
, fStencilBits(0) {}
@@ -40,11 +39,6 @@ public:
const DisplayParams& getDisplayParams() { return fDisplayParams; }
virtual void setDisplayParams(const DisplayParams& params) = 0;
- SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; }
- void setSurfaceProps(const SkSurfaceProps& props) {
- fSurfaceProps = props;
- }
-
GrContext* getGrContext() const { return fContext.get(); }
int width() const { return fWidth; }
@@ -60,7 +54,6 @@ protected:
int fWidth;
int fHeight;
DisplayParams fDisplayParams;
- SkSurfaceProps fSurfaceProps;
// parameters obtained from the native window
// Note that the platform .cpp file is responsible for
diff --git a/tools/sk_app/unix/RasterWindowContext_unix.cpp b/tools/sk_app/unix/RasterWindowContext_unix.cpp
index 6bfa6fd0be..d0e700cb2e 100644
--- a/tools/sk_app/unix/RasterWindowContext_unix.cpp
+++ b/tools/sk_app/unix/RasterWindowContext_unix.cpp
@@ -54,7 +54,7 @@ void RasterWindowContext_xlib::setDisplayParams(const DisplayParams& params) {
void RasterWindowContext_xlib::resize(int w, int h) {
SkImageInfo info = SkImageInfo::Make(w, h, fDisplayParams.fColorType, kPremul_SkAlphaType,
fDisplayParams.fColorSpace);
- fBackbufferSurface = SkSurface::MakeRaster(info);
+ fBackbufferSurface = SkSurface::MakeRaster(info, &fDisplayParams.fSurfaceProps);
}