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

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 211683002: Add discard API to SkCanvas, plumb it to glDiscardFramebuffer() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: move to ToT Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 #include "GrGLContext.h" 10 #include "GrGLContext.h"
(...skipping 27 matching lines...) Expand all
38 fTextureUsageSupport = false; 38 fTextureUsageSupport = false;
39 fTexStorageSupport = false; 39 fTexStorageSupport = false;
40 fTextureRedSupport = false; 40 fTextureRedSupport = false;
41 fImagingSupport = false; 41 fImagingSupport = false;
42 fTwoFormatLimit = false; 42 fTwoFormatLimit = false;
43 fFragCoordsConventionSupport = false; 43 fFragCoordsConventionSupport = false;
44 fVertexArrayObjectSupport = false; 44 fVertexArrayObjectSupport = false;
45 fUseNonVBOVertexAndIndexDynamicData = false; 45 fUseNonVBOVertexAndIndexDynamicData = false;
46 fIsCoreProfile = false; 46 fIsCoreProfile = false;
47 fFixedFunctionSupport = false; 47 fFixedFunctionSupport = false;
48 fDiscardFBSupport = false;
49 fFullClearIsFree = false; 48 fFullClearIsFree = false;
50 fDropsTileOnZeroDivide = false; 49 fDropsTileOnZeroDivide = false;
51 } 50 }
52 51
53 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { 52 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() {
54 *this = caps; 53 *this = caps;
55 } 54 }
56 55
57 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { 56 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) {
58 INHERITED::operator=(caps); 57 INHERITED::operator=(caps);
(...skipping 17 matching lines...) Expand all
76 fTextureUsageSupport = caps.fTextureUsageSupport; 75 fTextureUsageSupport = caps.fTextureUsageSupport;
77 fTexStorageSupport = caps.fTexStorageSupport; 76 fTexStorageSupport = caps.fTexStorageSupport;
78 fTextureRedSupport = caps.fTextureRedSupport; 77 fTextureRedSupport = caps.fTextureRedSupport;
79 fImagingSupport = caps.fImagingSupport; 78 fImagingSupport = caps.fImagingSupport;
80 fTwoFormatLimit = caps.fTwoFormatLimit; 79 fTwoFormatLimit = caps.fTwoFormatLimit;
81 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; 80 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport;
82 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; 81 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport;
83 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa ta; 82 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa ta;
84 fIsCoreProfile = caps.fIsCoreProfile; 83 fIsCoreProfile = caps.fIsCoreProfile;
85 fFixedFunctionSupport = caps.fFixedFunctionSupport; 84 fFixedFunctionSupport = caps.fFixedFunctionSupport;
86 fDiscardFBSupport = caps.fDiscardFBSupport;
87 fFullClearIsFree = caps.fFullClearIsFree; 85 fFullClearIsFree = caps.fFullClearIsFree;
88 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; 86 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide;
89 87
90 return *this; 88 return *this;
91 } 89 }
92 90
93 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { 91 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
94 92
95 this->reset(); 93 this->reset();
96 if (!ctxInfo.isInitialized()) { 94 if (!ctxInfo.isInitialized()) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 215
218 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha ve trouble with 216 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha ve trouble with
219 // frequently changing VBOs. We've measured a performance increase using non -VBO vertex 217 // frequently changing VBOs. We've measured a performance increase using non -VBO vertex
220 // data for dynamic content on these GPUs. Perhaps we should read the render er string and 218 // data for dynamic content on these GPUs. Perhaps we should read the render er string and
221 // limit this decision to specific GPU families rather than basing it on the vendor alone. 219 // limit this decision to specific GPU families rather than basing it on the vendor alone.
222 if (!GR_GL_MUST_USE_VBO && 220 if (!GR_GL_MUST_USE_VBO &&
223 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn fo.vendor())) { 221 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn fo.vendor())) {
224 fUseNonVBOVertexAndIndexDynamicData = true; 222 fUseNonVBOVertexAndIndexDynamicData = true;
225 } 223 }
226 224
227 fDiscardFBSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuffer"); 225 fDiscardRenderTargetSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuff er");
228 226
229 if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInf o.vendor()) { 227 if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInf o.vendor()) {
230 fFullClearIsFree = true; 228 fFullClearIsFree = true;
231 } 229 }
232 230
233 if (kGL_GrGLStandard == standard) { 231 if (kGL_GrGLStandard == standard) {
234 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || 232 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) ||
235 ctxInfo.hasExtension("GL_ARB_vertex_array_ob ject"); 233 ctxInfo.hasExtension("GL_ARB_vertex_array_ob ject");
236 } else { 234 } else {
237 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || 235 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) ||
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" )); 655 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" ));
658 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" )); 656 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" ));
659 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); 657 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO"));
660 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 658 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
661 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 659 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
662 r.appendf("Fragment coord conventions support: %s\n", 660 r.appendf("Fragment coord conventions support: %s\n",
663 (fFragCoordsConventionSupport ? "YES": "NO")); 661 (fFragCoordsConventionSupport ? "YES": "NO"));
664 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 662 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
665 r.appendf("Use non-VBO for dynamic data: %s\n", 663 r.appendf("Use non-VBO for dynamic data: %s\n",
666 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 664 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
667 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "NO"));
668 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 665 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
669 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 666 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
670 return r; 667 return r;
671 } 668 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698