Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 614883002: Use glDiscardFramebuffer to save memory bandwidth (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize())); 807 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize()));
808 } 808 }
809 } 809 }
810 } 810 }
811 811
812 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask) 812 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask)
813 { 813 {
814 if (isContextLost()) 814 if (isContextLost())
815 return false; 815 return false;
816 816
817 if (!drawingBuffer()->layerComposited() || m_layerCleared 817 if (!drawingBuffer()->layerComposited() || drawingBuffer()->discardFramebuff erSupported() || m_layerCleared
818 || m_requestedAttributes->preserveDrawingBuffer() || (mask && m_framebuf ferBinding)) 818 || m_requestedAttributes->preserveDrawingBuffer() || (mask && m_framebuf ferBinding))
819 return false; 819 return false;
820 820
821 RefPtrWillBeRawPtr<WebGLContextAttributes> contextAttributes = getContextAtt ributes(); 821 RefPtrWillBeRawPtr<WebGLContextAttributes> contextAttributes = getContextAtt ributes();
822 822
823 // Determine if it's possible to combine the clear the user asked for and th is clear. 823 // Determine if it's possible to combine the clear the user asked for and th is clear.
824 bool combinedClear = mask && !m_scissorEnabled; 824 bool combinedClear = mask && !m_scissorEnabled;
825 825
826 webContext()->disable(GL_SCISSOR_TEST); 826 webContext()->disable(GL_SCISSOR_TEST);
827 if (combinedClear && (mask & GL_COLOR_BUFFER_BIT)) { 827 if (combinedClear && (mask & GL_COLOR_BUFFER_BIT)) {
(...skipping 4966 matching lines...) Expand 10 before | Expand all | Expand 10 after
5794 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 5794 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
5795 } 5795 }
5796 #else 5796 #else
5797 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 5797 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
5798 { 5798 {
5799 return m_drawingBuffer.get(); 5799 return m_drawingBuffer.get();
5800 } 5800 }
5801 #endif 5801 #endif
5802 5802
5803 } // namespace blink 5803 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698