aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/SkV8Example
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/SkV8Example')
-rw-r--r--experimental/SkV8Example/SkV8Example.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp
index a6a2a7e816..b4a0db633b 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"
@@ -85,19 +84,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();
}
}