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 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 /////////////////////////////////////////////////////////////////////////////// | 612 /////////////////////////////////////////////////////////////////////////////// |
613 | 613 |
614 bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params, | 614 bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params, |
615 int width, int height) const { | 615 int width, int height) const { |
616 const GrDrawTargetCaps* caps = fGpu->caps(); | 616 const GrDrawTargetCaps* caps = fGpu->caps(); |
617 if (!caps->isConfigTexturable(kIndex_8_GrPixelConfig)) { | 617 if (!caps->isConfigTexturable(kIndex_8_GrPixelConfig)) { |
618 return false; | 618 return false; |
619 } | 619 } |
620 | 620 |
621 bool isPow2 = GrIsPow2(width) && GrIsPow2(height); | 621 bool isPow2 = SkIsPow2(width) && SkIsPow2(height); |
622 | 622 |
623 if (!isPow2) { | 623 if (!isPow2) { |
624 bool tiled = NULL != params && params->isTiled(); | 624 bool tiled = NULL != params && params->isTiled(); |
625 if (tiled && !caps->npotTextureTileSupport()) { | 625 if (tiled && !caps->npotTextureTileSupport()) { |
626 return false; | 626 return false; |
627 } | 627 } |
628 } | 628 } |
629 return true; | 629 return true; |
630 } | 630 } |
631 | 631 |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1838 SkSafeRef(resource); | 1838 SkSafeRef(resource); |
1839 return resource; | 1839 return resource; |
1840 } | 1840 } |
1841 | 1841 |
1842 /////////////////////////////////////////////////////////////////////////////// | 1842 /////////////////////////////////////////////////////////////////////////////// |
1843 #if GR_CACHE_STATS | 1843 #if GR_CACHE_STATS |
1844 void GrContext::printCacheStats() const { | 1844 void GrContext::printCacheStats() const { |
1845 fResourceCache->printStats(); | 1845 fResourceCache->printStats(); |
1846 } | 1846 } |
1847 #endif | 1847 #endif |
OLD | NEW |