aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-05-05 12:24:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-05 12:24:31 -0700
commit2d1ee7936e3536e45c963db004e3b512bb415fd8 (patch)
treeedefade2fbe8c19d10abae08f3a658f202bbb5c1 /include
parentd215a95882485026d176a81bf58871276b21c89c (diff)
Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel
buffer. (Only on Windows at the moment). Uses new effect to do the final gamma adjustment BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919993002 Review-Url: https://codereview.chromium.org/1919993002
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h10
-rw-r--r--include/gpu/GrSurface.h2
-rw-r--r--include/views/SkOSWindow_Android.h3
-rw-r--r--include/views/SkOSWindow_Mac.h3
-rw-r--r--include/views/SkOSWindow_SDL.h2
-rw-r--r--include/views/SkOSWindow_Unix.h2
-rw-r--r--include/views/SkOSWindow_Win.h4
-rw-r--r--include/views/SkOSWindow_iOS.h3
-rw-r--r--include/views/SkWindow.h6
9 files changed, 26 insertions, 9 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 6f5ca981e5..b6fa30bc35 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -293,8 +293,16 @@ public:
uint32_t pixelOpsFlags = 0);
/**
+ * Copies contents of src to dst, while applying a gamma curve. Fails if the two surfaces
+ * are not identically sized.
+ * @param dst the surface to copy to.
+ * @param src the texture to copy from.
+ * @param gamma the gamma value to apply.
+ */
+ bool applyGamma(GrRenderTarget* dst, GrTexture* src, SkScalar gamma);
+
+ /**
* Copies a rectangle of texels from src to dst.
- * bounds.
* @param dst the surface to copy to.
* @param src the surface to copy from.
* @param srcRect the rectangle of the src that should be copied.
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index b87b2dbaf0..8c6930a7a7 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -100,7 +100,7 @@ public:
* packed.
* @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
*
- * @return true if the read succeeded, false if not. The read can fail because of an
+ * @return true if the write succeeded, false if not. The write can fail because of an
* unsupported pixel config.
*/
bool writePixels(int left, int top, int width, int height,
diff --git a/include/views/SkOSWindow_Android.h b/include/views/SkOSWindow_Android.h
index 74175bafd1..234e65c256 100644
--- a/include/views/SkOSWindow_Android.h
+++ b/include/views/SkOSWindow_Android.h
@@ -28,7 +28,8 @@ public:
kNativeGL_BackEndType,
};
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
+ AttachmentInfo* info);
void release();
void present();
bool makeFullscreen() { return true; }
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index efa97bf872..4558a58833 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -33,7 +33,8 @@ public:
};
void release();
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
+ AttachmentInfo*);
void present();
bool makeFullscreen();
diff --git a/include/views/SkOSWindow_SDL.h b/include/views/SkOSWindow_SDL.h
index 6823441715..1ab51ca415 100644
--- a/include/views/SkOSWindow_SDL.h
+++ b/include/views/SkOSWindow_SDL.h
@@ -29,7 +29,7 @@ public:
};
void release();
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor, AttachmentInfo*);
void present();
bool makeFullscreen();
void setVsync(bool);
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index 30386da183..2e1b9ccc81 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -44,7 +44,7 @@ public:
#endif // SK_COMMAND_BUFFER
};
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor, AttachmentInfo*);
void release();
void present();
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index eb8b1fc892..8d5378108e 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -47,7 +47,7 @@ public:
#endif // SK_SUPPORT_GPU
};
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor, AttachmentInfo*);
void release();
void present();
@@ -127,7 +127,7 @@ private:
void updateSize();
#if SK_SUPPORT_GPU
- bool attachGL(int msaaSampleCount, AttachmentInfo* info);
+ bool attachGL(int msaaSampleCount, bool deepColor, AttachmentInfo* info);
void detachGL();
void presentGL();
diff --git a/include/views/SkOSWindow_iOS.h b/include/views/SkOSWindow_iOS.h
index 5a8b2e3d2f..c0b2fc3f0a 100644
--- a/include/views/SkOSWindow_iOS.h
+++ b/include/views/SkOSWindow_iOS.h
@@ -22,7 +22,8 @@ public:
};
void release();
- bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
+ bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
+ AttachmentInfo*);
void present();
bool makeFullscreen() { return true; }
diff --git a/include/views/SkWindow.h b/include/views/SkWindow.h
index b4fabd253e..341046aacc 100644
--- a/include/views/SkWindow.h
+++ b/include/views/SkWindow.h
@@ -32,8 +32,14 @@ public:
virtual ~SkWindow();
struct AttachmentInfo {
+ AttachmentInfo()
+ : fSampleCount(0)
+ , fStencilBits(0)
+ , fColorBits(0) {}
+
int fSampleCount;
int fStencilBits;
+ int fColorBits;
};
SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; }