| OLD | NEW | 
|---|
| 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 #include "GrContext.h" | 9 #include "GrContext.h" | 
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44         // we'd expect because we never change fDesc.fWidth/fHeight. | 44         // we'd expect because we never change fDesc.fWidth/fHeight. | 
| 45         textureSize *= 2; | 45         textureSize *= 2; | 
| 46     } | 46     } | 
| 47     return textureSize; | 47     return textureSize; | 
| 48 } | 48 } | 
| 49 | 49 | 
| 50 void GrTexture::validateDesc() const { | 50 void GrTexture::validateDesc() const { | 
| 51     if (this->asRenderTarget()) { | 51     if (this->asRenderTarget()) { | 
| 52         // This texture has a render target | 52         // This texture has a render target | 
| 53         SkASSERT(0 != (fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); | 53         SkASSERT(0 != (fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); | 
| 54         SkASSERT(fDesc.fSampleCnt == this->asRenderTarget()->numSamples()); | 54         SkASSERT(fDesc.fSampleCnt == this->asRenderTarget()->numColorSamples()); | 
| 55     } else { | 55     } else { | 
| 56         SkASSERT(0 == (fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); | 56         SkASSERT(0 == (fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); | 
| 57         SkASSERT(0 == fDesc.fSampleCnt); | 57         SkASSERT(0 == fDesc.fSampleCnt); | 
| 58     } | 58     } | 
| 59 } | 59 } | 
| 60 | 60 | 
| 61 ////////////////////////////////////////////////////////////////////////////// | 61 ////////////////////////////////////////////////////////////////////////////// | 
| 62 | 62 | 
| 63 namespace { | 63 namespace { | 
| 64 | 64 | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 102     SkASSERT(desc.fWidth <= SK_MaxU16); | 102     SkASSERT(desc.fWidth <= SK_MaxU16); | 
| 103     SkASSERT(desc.fHeight <= SK_MaxU16); | 103     SkASSERT(desc.fHeight <= SK_MaxU16); | 
| 104     SkASSERT(static_cast<int>(desc.fConfig) < (1 << 6)); | 104     SkASSERT(static_cast<int>(desc.fConfig) < (1 << 6)); | 
| 105     SkASSERT(desc.fSampleCnt < (1 << 8)); | 105     SkASSERT(desc.fSampleCnt < (1 << 8)); | 
| 106     SkASSERT(flags < (1 << 10)); | 106     SkASSERT(flags < (1 << 10)); | 
| 107     SkASSERT(static_cast<int>(origin) < (1 << 8)); | 107     SkASSERT(static_cast<int>(origin) < (1 << 8)); | 
| 108 | 108 | 
| 109     builder[0] = desc.fWidth | (desc.fHeight << 16); | 109     builder[0] = desc.fWidth | (desc.fHeight << 16); | 
| 110     builder[1] = desc.fConfig | (desc.fSampleCnt << 6) | (flags << 14) | (origin
      << 24); | 110     builder[1] = desc.fConfig | (desc.fSampleCnt << 6) | (flags << 14) | (origin
      << 24); | 
| 111 } | 111 } | 
| OLD | NEW | 
|---|