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

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

Issue 1286203002: Defer flushes if kPreferNoIO is specified (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use explicit size in test Created 5 years, 4 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 | « src/gpu/GrTextureProvider.cpp ('k') | tests/ResourceCacheTest.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 #include "GrGLRenderTarget.h" 8 #include "GrGLRenderTarget.h"
9 9
10 #include "GrGLGpu.h" 10 #include "GrGLGpu.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 colorValuesPerPixel += 1; 45 colorValuesPerPixel += 1;
46 } else if (fTexFBOID != 0) { 46 } else if (fTexFBOID != 0) {
47 // For auto-resolving FBOs, the MSAA buffer is free. 47 // For auto-resolving FBOs, the MSAA buffer is free.
48 colorValuesPerPixel = 1; 48 colorValuesPerPixel = 1;
49 } 49 }
50 SkASSERT(kUnknown_GrPixelConfig != fDesc.fConfig); 50 SkASSERT(kUnknown_GrPixelConfig != fDesc.fConfig);
51 SkASSERT(!GrPixelConfigIsCompressed(fDesc.fConfig)); 51 SkASSERT(!GrPixelConfigIsCompressed(fDesc.fConfig));
52 size_t colorBytes = GrBytesPerPixel(fDesc.fConfig); 52 size_t colorBytes = GrBytesPerPixel(fDesc.fConfig);
53 SkASSERT(colorBytes > 0); 53 SkASSERT(colorBytes > 0);
54 fGpuMemorySize = colorValuesPerPixel * fDesc.fWidth * fDesc.fHeight * colorB ytes; 54 fGpuMemorySize = colorValuesPerPixel * fDesc.fWidth * fDesc.fHeight * colorB ytes;
55
56 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc));
55 } 57 }
56 58
57 size_t GrGLRenderTarget::onGpuMemorySize() const { 59 size_t GrGLRenderTarget::onGpuMemorySize() const {
58 return fGpuMemorySize; 60 return fGpuMemorySize;
59 } 61 }
60 62
61 void GrGLRenderTarget::onRelease() { 63 void GrGLRenderTarget::onRelease() {
62 if (kBorrowed_LifeCycle != fRTLifecycle) { 64 if (kBorrowed_LifeCycle != fRTLifecycle) {
63 if (fTexFBOID) { 65 if (fTexFBOID) {
64 GL_CALL(DeleteFramebuffers(1, &fTexFBOID)); 66 GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
(...skipping 10 matching lines...) Expand all
75 fMSColorRenderbufferID = 0; 77 fMSColorRenderbufferID = 0;
76 INHERITED::onRelease(); 78 INHERITED::onRelease();
77 } 79 }
78 80
79 void GrGLRenderTarget::onAbandon() { 81 void GrGLRenderTarget::onAbandon() {
80 fRTFBOID = 0; 82 fRTFBOID = 0;
81 fTexFBOID = 0; 83 fTexFBOID = 0;
82 fMSColorRenderbufferID = 0; 84 fMSColorRenderbufferID = 0;
83 INHERITED::onAbandon(); 85 INHERITED::onAbandon();
84 } 86 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextureProvider.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698