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

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

Issue 216503004: SK_SUPPORT_LEGACY_GRTYPES to hide duplicate types from SkTypes.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 size_t GrRenderTarget::sizeInBytes() const { 57 size_t GrRenderTarget::sizeInBytes() const {
58 size_t colorBits; 58 size_t colorBits;
59 if (kUnknown_GrPixelConfig == fDesc.fConfig) { 59 if (kUnknown_GrPixelConfig == fDesc.fConfig) {
60 colorBits = 32; // don't know, make a guess 60 colorBits = 32; // don't know, make a guess
61 } else { 61 } else {
62 colorBits = GrBytesPerPixel(fDesc.fConfig); 62 colorBits = GrBytesPerPixel(fDesc.fConfig);
63 } 63 }
64 uint64_t size = fDesc.fWidth; 64 uint64_t size = fDesc.fWidth;
65 size *= fDesc.fHeight; 65 size *= fDesc.fHeight;
66 size *= colorBits; 66 size *= colorBits;
67 size *= GrMax(1, fDesc.fSampleCnt); 67 size *= SkTMax(1, fDesc.fSampleCnt);
68 return (size_t)(size / 8); 68 return (size_t)(size / 8);
69 } 69 }
70 70
71 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) { 71 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
72 if (kCanResolve_ResolveType == getResolveType()) { 72 if (kCanResolve_ResolveType == getResolveType()) {
73 if (NULL != rect) { 73 if (NULL != rect) {
74 fResolveRect.join(*rect); 74 fResolveRect.join(*rect);
75 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) { 75 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) {
76 fResolveRect.setEmpty(); 76 fResolveRect.setEmpty();
77 } 77 }
(...skipping 22 matching lines...) Expand all
100 this->setStencilBuffer(NULL); 100 this->setStencilBuffer(NULL);
101 101
102 INHERITED::onRelease(); 102 INHERITED::onRelease();
103 } 103 }
104 104
105 void GrRenderTarget::onAbandon() { 105 void GrRenderTarget::onAbandon() {
106 this->setStencilBuffer(NULL); 106 this->setStencilBuffer(NULL);
107 107
108 INHERITED::onAbandon(); 108 INHERITED::onAbandon();
109 } 109 }
OLDNEW
« include/gpu/GrPoint.h ('K') | « src/gpu/GrPathUtils.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698