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

Side by Side Diff: src/gpu/GrRenderTarget.cpp

Issue 359803003: 32 bpp floating point textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback incorporated Created 6 years, 5 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/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return; 61 return;
62 } 62 }
63 context->discardRenderTarget(this); 63 context->discardRenderTarget(this);
64 } 64 }
65 65
66 size_t GrRenderTarget::gpuMemorySize() const { 66 size_t GrRenderTarget::gpuMemorySize() const {
67 size_t colorBits; 67 size_t colorBits;
68 if (kUnknown_GrPixelConfig == fDesc.fConfig) { 68 if (kUnknown_GrPixelConfig == fDesc.fConfig) {
69 colorBits = 32; // don't know, make a guess 69 colorBits = 32; // don't know, make a guess
70 } else { 70 } else {
71 colorBits = GrBytesPerPixel(fDesc.fConfig); 71 colorBits = GrBytesPerPixel(fDesc.fConfig) * 8;
72 } 72 }
73 uint64_t size = fDesc.fWidth; 73 uint64_t size = fDesc.fWidth;
74 size *= fDesc.fHeight; 74 size *= fDesc.fHeight;
75 size *= colorBits; 75 size *= colorBits;
76 size *= SkTMax(1, fDesc.fSampleCnt); 76 size *= SkTMax(1, fDesc.fSampleCnt);
77 return (size_t)(size / 8); 77 return (size_t)(size / 8);
78 } 78 }
79 79
80 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) { 80 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
81 if (kCanResolve_ResolveType == getResolveType()) { 81 if (kCanResolve_ResolveType == getResolveType()) {
(...skipping 27 matching lines...) Expand all
109 this->setStencilBuffer(NULL); 109 this->setStencilBuffer(NULL);
110 110
111 INHERITED::onRelease(); 111 INHERITED::onRelease();
112 } 112 }
113 113
114 void GrRenderTarget::onAbandon() { 114 void GrRenderTarget::onAbandon() {
115 this->setStencilBuffer(NULL); 115 this->setStencilBuffer(NULL);
116 116
117 INHERITED::onAbandon(); 117 INHERITED::onAbandon();
118 } 118 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698