aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-07-20 20:48:12 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-20 20:48:23 +0000
commit807371c15bd742efb98a9df6e1dee73e8bda8af5 (patch)
tree3fd563c6347d5948e3a1410adffdf46492bdbd4a /experimental
parent3b59af5bf88920515835c79fe07c302438dc8e55 (diff)
Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget."
This reverts commit e2d37c2a07f5473e5fc6fb65e9e23e14127580e9. Reason for revert: <INSERT REASONING HERE> Original change's description: > Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget. > > Also removes a reference to GrBackendTextureDesc in a comment and updates markdown docs. > > Docs-Preview: https://skia.org/?cl=24861 > Bug: skia: > Change-Id: Ic6490d5ef46953450e6dee69271397bb2b94d0d6 > Reviewed-on: https://skia-review.googlesource.com/24861 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I4b85b529727f0bf5aec21d87e725a8195666e2e5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/25182 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/GLFWTest/glfw_main.cpp28
-rw-r--r--experimental/SkV8Example/SkV8Example.cpp25
2 files changed, 28 insertions, 25 deletions
diff --git a/experimental/GLFWTest/glfw_main.cpp b/experimental/GLFWTest/glfw_main.cpp
index 34fbd4ed55..63ea1f1d9f 100644
--- a/experimental/GLFWTest/glfw_main.cpp
+++ b/experimental/GLFWTest/glfw_main.cpp
@@ -5,11 +5,12 @@
* 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"
@@ -31,18 +32,17 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
static void init_skia(int w, int h) {
sContext = GrContext::Create(kOpenGL_GrBackend, 0);
-
- 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();
+
+ 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();
}
static void cleanup_skia() {
diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp
index b4a0db633b..a6a2a7e816 100644
--- a/experimental/SkV8Example/SkV8Example.cpp
+++ b/experimental/SkV8Example/SkV8Example.cpp
@@ -8,12 +8,13 @@
*/
#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,17 +85,19 @@ void SkV8ExampleWindow::windowSizeChanged() {
exit(1);
}
- 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);
+ 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;
+
SkSafeUnref(fCurSurface);
- fCurSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext, backendRenderTarget,
- kBottomLeft_GrSurfaceOrigin,
+ fCurSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext, desc,
nullptr, nullptr).release();
}
}