提交 bab7fa77 编写于 作者: J Jason Simmons 提交者: GitHub

fix sRGB typo (#3942)

上级 b09af51b
...@@ -24,7 +24,7 @@ static const size_t kGrCacheMaxByteSize = 512 * (1 << 20); ...@@ -24,7 +24,7 @@ static const size_t kGrCacheMaxByteSize = 512 * (1 << 20);
GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate) GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate)
: delegate_(delegate), : delegate_(delegate),
onscreen_surface_supports_sgrb_(delegate_->SurfaceSupportsSRGB()), onscreen_surface_supports_srgb_(delegate_->SurfaceSupportsSRGB()),
weak_factory_(this) { weak_factory_(this) {
if (!delegate_->GLContextMakeCurrent()) { if (!delegate_->GLContextMakeCurrent()) {
FTL_LOG(ERROR) FTL_LOG(ERROR)
...@@ -156,13 +156,13 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { ...@@ -156,13 +156,13 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) {
onscreen_surface = onscreen_surface =
WrapOnscreenSurface(context_.get(), size, delegate_->GLContextFBO(), WrapOnscreenSurface(context_.get(), size, delegate_->GLContextFBO(),
onscreen_surface_supports_sgrb_); onscreen_surface_supports_srgb_);
if (onscreen_surface == nullptr) { if (onscreen_surface == nullptr) {
FTL_LOG(ERROR) << "Could not wrap onscreen surface."; FTL_LOG(ERROR) << "Could not wrap onscreen surface.";
return false; return false;
} }
if (!onscreen_surface_supports_sgrb_) { if (!onscreen_surface_supports_srgb_) {
offscreen_surface = CreateOffscreenSurface(context_.get(), size); offscreen_surface = CreateOffscreenSurface(context_.get(), size);
if (offscreen_surface == nullptr) { if (offscreen_surface == nullptr) {
FTL_LOG(ERROR) << "Could not create offscreen surface."; FTL_LOG(ERROR) << "Could not create offscreen surface.";
...@@ -208,7 +208,7 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) { ...@@ -208,7 +208,7 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) {
return false; return false;
} }
if (!onscreen_surface_supports_sgrb_) { if (!onscreen_surface_supports_srgb_) {
// Because the surface did not support sRGB, we rendered to an offscreen // Because the surface did not support sRGB, we rendered to an offscreen
// surface. Now we must ensure that the texture is copied onscreen. // surface. Now we must ensure that the texture is copied onscreen.
TRACE_EVENT0("flutter", "CopyTextureOnscreen"); TRACE_EVENT0("flutter", "CopyTextureOnscreen");
...@@ -241,7 +241,7 @@ sk_sp<SkSurface> GPUSurfaceGL::AcquireRenderSurface(const SkISize& size) { ...@@ -241,7 +241,7 @@ sk_sp<SkSurface> GPUSurfaceGL::AcquireRenderSurface(const SkISize& size) {
return nullptr; return nullptr;
} }
return onscreen_surface_supports_sgrb_ ? onscreen_surface_ return onscreen_surface_supports_srgb_ ? onscreen_surface_
: offscreen_surface_; : offscreen_surface_;
} }
......
...@@ -40,7 +40,7 @@ class GPUSurfaceGL : public Surface { ...@@ -40,7 +40,7 @@ class GPUSurfaceGL : public Surface {
private: private:
GPUSurfaceGLDelegate* delegate_; GPUSurfaceGLDelegate* delegate_;
bool onscreen_surface_supports_sgrb_; bool onscreen_surface_supports_srgb_;
sk_sp<GrContext> context_; sk_sp<GrContext> context_;
sk_sp<SkSurface> onscreen_surface_; sk_sp<SkSurface> onscreen_surface_;
sk_sp<SkSurface> offscreen_surface_; sk_sp<SkSurface> offscreen_surface_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册