aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-04-27 18:48:15 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-27 18:48:19 +0000
commite3bd422fafc74dd3410c3de24a576635be92c3b4 (patch)
tree63bc3f6768299f8e4dde996df333ea4022855efe /src/views
parentdf7e075c74110fcfebdc49ca503684162e118af5 (diff)
Revert "Plumb the use of GrBackendRenderTarget throughout Skia"
This reverts commit fdd77daedbba3b7c53be74a82fb9fae891b51696. Reason for revert: Apparently I have a few more build files to update before this can land. Original change's description: > Plumb the use of GrBackendRenderTarget throughout Skia > > Bug: skia: > Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa > Reviewed-on: https://skia-review.googlesource.com/14148 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I984e1909870182474c4c3cce257f01b6a9d8581f Reviewed-on: https://skia-review.googlesource.com/14531 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/views')
-rw-r--r--src/views/SkWindow.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index ba06a1f3c2..f86bb9f9ef 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -316,7 +316,6 @@ bool SkWindow::onDispatchClick(int x, int y, Click::State state,
#if SK_SUPPORT_GPU
-#include "GrBackendSurface.h"
#include "GrContext.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"
@@ -325,9 +324,10 @@ bool SkWindow::onDispatchClick(int x, int y, Click::State state,
sk_sp<SkSurface> SkWindow::makeGpuBackedSurface(const AttachmentInfo& attachmentInfo,
const GrGLInterface* interface,
GrContext* grContext) {
- int width = SkScalarRoundToInt(this->width());
- int height = SkScalarRoundToInt(this->height());
- if (0 == width || 0 == height) {
+ GrBackendRenderTargetDesc desc;
+ desc.fWidth = SkScalarRoundToInt(this->width());
+ desc.fHeight = SkScalarRoundToInt(this->height());
+ if (0 == desc.fWidth || 0 == desc.fHeight) {
return nullptr;
}
@@ -340,28 +340,22 @@ sk_sp<SkSurface> SkWindow::makeGpuBackedSurface(const AttachmentInfo& attachment
//
// ... and, if we're using a 10-bit/channel FB0, it doesn't do sRGB conversion on write,
// so pretend that it's non-sRGB 8888:
- GrPixelConfig config = grContext->caps()->srgbSupport() &&
- info().colorSpace() &&
- (attachmentInfo.fColorBits != 30)
- ? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
- GrGLFramebufferInfo fbInfo;
+ desc.fConfig =
+ grContext->caps()->srgbSupport() &&
+ info().colorSpace() &&
+ (attachmentInfo.fColorBits != 30)
+ ? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
+ desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
+ desc.fSampleCnt = attachmentInfo.fSampleCount;
+ desc.fStencilBits = attachmentInfo.fStencilBits;
GrGLint buffer;
GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer);
- fbInfo.fFBOID = buffer;
-
- GrBackendRenderTarget backendRT(width,
- height,
- attachmentInfo.fSampleCount,
- attachmentInfo.fStencilBits,
- config,
- fbInfo);
-
+ desc.fRenderTargetHandle = buffer;
sk_sp<SkColorSpace> colorSpace =
grContext->caps()->srgbSupport() && info().colorSpace()
? SkColorSpace::MakeSRGB() : nullptr;
- return SkSurface::MakeFromBackendRenderTarget(grContext, backendRT, kBottomLeft_GrSurfaceOrigin,
- colorSpace, &fSurfaceProps);
+ return SkSurface::MakeFromBackendRenderTarget(grContext, desc, colorSpace, &fSurfaceProps);
}
#endif