diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-30 13:37:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-30 17:59:46 +0000 |
commit | 71554bc256b705fe959b7aa2fb2f24ed48782362 (patch) | |
tree | 07892c5f1e995e550285b3e1197b98f731e7970a /experimental | |
parent | 1b4602bd9b29feaecc6255db5ddc384835d7ee0a (diff) |
Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget.""
This reverts commit 807371c15bd742efb98a9df6e1dee73e8bda8af5.
Docs-Preview: https://skia.org/?cl=40260
Change-Id: I28e0434c455155ff39a5aaa4141abdf442474e87
Reviewed-on: https://skia-review.googlesource.com/40260
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/GLFWTest/glfw_main.cpp | 26 | ||||
-rw-r--r-- | experimental/SkV8Example/SkV8Example.cpp | 25 |
2 files changed, 24 insertions, 27 deletions
diff --git a/experimental/GLFWTest/glfw_main.cpp b/experimental/GLFWTest/glfw_main.cpp index 6b8412ce9b..f0e3297e8a 100644 --- a/experimental/GLFWTest/glfw_main.cpp +++ b/experimental/GLFWTest/glfw_main.cpp @@ -5,12 +5,11 @@ * found in the LICENSE file. */ -#include "GLFW/glfw3.h" #include <stdlib.h> #include <stdio.h> - +#include "GLFW/glfw3.h" +#include "GrBackendSurface.h" #include "GrContext.h" - #include "SkCanvas.h" #include "SkImage.h" #include "SkRSXform.h" @@ -33,16 +32,17 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, static void init_skia(int w, int h) { sContext = GrContext::MakeGL(nullptr).release(); - GrBackendRenderTargetDesc desc; - desc.fWidth = w; - desc.fHeight = h; - desc.fConfig = kSkia8888_GrPixelConfig; - desc.fOrigin = kBottomLeft_GrSurfaceOrigin; - desc.fSampleCnt = 1; - desc.fStencilBits = 0; - desc.fRenderTargetHandle = 0; // assume default framebuffer - - sSurface = SkSurface::MakeFromBackendRenderTarget(sContext, desc, nullptr, nullptr).release(); + GrGLFramebufferInfo framebufferInfo; + framebufferInfo.fFBOID = 0; // assume default framebuffer + GrBackendRenderTarget backendRenderTarget(w, h, + 0, // sample count + 0, // stencil bits + kSkia8888_GrPixelConfig, + framebufferInfo); + + sSurface = SkSurface::MakeFromBackendRenderTarget(sContext, backendRenderTarget, + kBottomLeft_GrSurfaceOrigin, + nullptr, nullptr).release(); } static void cleanup_skia() { diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp index ca63e071b7..5cad12577f 100644 --- a/experimental/SkV8Example/SkV8Example.cpp +++ b/experimental/SkV8Example/SkV8Example.cpp @@ -8,13 +8,12 @@ */ #include <v8.h> #include <include/libplatform/libplatform.h> - #include "SkV8Example.h" #include "Global.h" #include "JsContext.h" #include "Path2D.h" #include "Path2DBuilder.h" - +#include "GrBackendSurface.h" #include "gl/GrGLUtil.h" #include "gl/GrGLDefines.h" #include "gl/GrGLInterface.h" @@ -84,19 +83,17 @@ void SkV8ExampleWindow::windowSizeChanged() { exit(1); } - GrBackendRenderTargetDesc desc; - desc.fWidth = SkScalarRoundToInt(this->width()); - desc.fHeight = SkScalarRoundToInt(this->height()); - desc.fConfig = kSkia8888_GrPixelConfig; - desc.fOrigin = kBottomLeft_GrSurfaceOrigin; - desc.fSampleCnt = attachmentInfo.fSampleCount; - desc.fStencilBits = attachmentInfo.fStencilBits; - GrGLint buffer; - GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer); - desc.fRenderTargetHandle = buffer; - + GrGLFramebufferInfo framebufferInfo; + GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &framebufferInfo.fFBOID); + GrBackendRenderTarget backendRenderTarget(SkScalarRoundToInt(this->width()), + SkScalarRoundToInt(this->height()), + attachmentInfo.fSampleCount, + attachmentInfo.fStencilBits, + kSkia8888_GrPixelConfig, + framebufferInfo); SkSafeUnref(fCurSurface); - fCurSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext, desc, + fCurSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext, backendRenderTarget, + kBottomLeft_GrSurfaceOrigin, nullptr, nullptr).release(); } } |