| OLD | NEW |
| 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 #include "GrSurface.h" | 8 #include "GrSurface.h" |
| 9 #include "GrContext.h" |
| 9 #include "GrSurfacePriv.h" | 10 #include "GrSurfacePriv.h" |
| 10 | 11 |
| 11 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 12 #include "SkGr.h" | 13 #include "SkGrPriv.h" |
| 13 #include "SkImageEncoder.h" | 14 #include "SkImageEncoder.h" |
| 14 #include <stdio.h> | 15 #include <stdio.h> |
| 15 | 16 |
| 16 size_t GrSurface::WorseCaseSize(const GrSurfaceDesc& desc) { | 17 size_t GrSurface::WorseCaseSize(const GrSurfaceDesc& desc) { |
| 17 size_t size; | 18 size_t size; |
| 18 | 19 |
| 19 bool isRenderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); | 20 bool isRenderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); |
| 20 if (isRenderTarget) { | 21 if (isRenderTarget) { |
| 21 // We own one color value for each MSAA sample. | 22 // We own one color value for each MSAA sample. |
| 22 int colorValuesPerPixel = SkTMax(1, desc.fSampleCnt); | 23 int colorValuesPerPixel = SkTMax(1, desc.fSampleCnt); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 203 |
| 203 void GrSurface::onRelease() { | 204 void GrSurface::onRelease() { |
| 204 this->invokeReleaseProc(); | 205 this->invokeReleaseProc(); |
| 205 this->INHERITED::onRelease(); | 206 this->INHERITED::onRelease(); |
| 206 } | 207 } |
| 207 | 208 |
| 208 void GrSurface::onAbandon() { | 209 void GrSurface::onAbandon() { |
| 209 this->invokeReleaseProc(); | 210 this->invokeReleaseProc(); |
| 210 this->INHERITED::onAbandon(); | 211 this->INHERITED::onAbandon(); |
| 211 } | 212 } |
| OLD | NEW |