提交 7b612b0f 编写于 作者: C Chinmay Garde 提交者: GitHub

iOS: Discard the depth and stencil attachments of the framebuffer before...

iOS: Discard the depth and stencil attachments of the framebuffer before presenting the color renderbuffer. (#2737)
上级 341495d5
......@@ -71,7 +71,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const {
const SkScalar bottom = y + height;
const SkScalar right = x + width;
// Scale the graph to show frame times up to those that are 4 times the frame time.
// Scale the graph to show frame times up to those that are 3 times the frame time.
const double max_interval = kOneFrameMS * 3.0;
const double max_unit_interval = UnitFrameInterval(max_interval);
......
......@@ -216,6 +216,14 @@ void GLSurfaceIOS::SetupFramebufferIfNecessary() {
}
bool GLSurfaceIOS::SwapBuffers() {
const GLenum discards[] = {
GL_DEPTH_ATTACHMENT,
GL_STENCIL_ATTACHMENT,
};
glDiscardFramebufferEXT(GL_FRAMEBUFFER, sizeof(discards) / sizeof(GLenum),
discards);
glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_);
return [[EAGLContext currentContext] presentRenderbuffer:GL_RENDERBUFFER];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册