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

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

Issue 12843026: Make GrDrawTarget::Caps ref counted and GrGLCaps derive from it. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 "GrContext.h" 10 #include "GrContext.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 void GrContext::getTextureCacheLimits(int* maxTextures, 541 void GrContext::getTextureCacheLimits(int* maxTextures,
542 size_t* maxTextureBytes) const { 542 size_t* maxTextureBytes) const {
543 fTextureCache->getLimits(maxTextures, maxTextureBytes); 543 fTextureCache->getLimits(maxTextures, maxTextureBytes);
544 } 544 }
545 545
546 void GrContext::setTextureCacheLimits(int maxTextures, size_t maxTextureBytes) { 546 void GrContext::setTextureCacheLimits(int maxTextures, size_t maxTextureBytes) {
547 fTextureCache->setLimits(maxTextures, maxTextureBytes); 547 fTextureCache->setLimits(maxTextures, maxTextureBytes);
548 } 548 }
549 549
550 int GrContext::getMaxTextureSize() const { 550 int GrContext::getMaxTextureSize() const {
551 return fGpu->getCaps().maxTextureSize(); 551 return fGpu->caps()->maxTextureSize();
552 } 552 }
553 553
554 int GrContext::getMaxRenderTargetSize() const { 554 int GrContext::getMaxRenderTargetSize() const {
555 return fGpu->getCaps().maxRenderTargetSize(); 555 return fGpu->caps()->maxRenderTargetSize();
556 } 556 }
557 557
558 int GrContext::getMaxSampleCount() const { 558 int GrContext::getMaxSampleCount() const {
559 return fGpu->getCaps().maxSampleCount(); 559 return fGpu->caps()->maxSampleCount();
560 } 560 }
561 561
562 /////////////////////////////////////////////////////////////////////////////// 562 ///////////////////////////////////////////////////////////////////////////////
563 563
564 GrTexture* GrContext::wrapBackendTexture(const GrBackendTextureDesc& desc) { 564 GrTexture* GrContext::wrapBackendTexture(const GrBackendTextureDesc& desc) {
565 return fGpu->wrapBackendTexture(desc); 565 return fGpu->wrapBackendTexture(desc);
566 } 566 }
567 567
568 GrRenderTarget* GrContext::wrapBackendRenderTarget(const GrBackendRenderTargetDe sc& desc) { 568 GrRenderTarget* GrContext::wrapBackendRenderTarget(const GrBackendRenderTargetDe sc& desc) {
569 return fGpu->wrapBackendRenderTarget(desc); 569 return fGpu->wrapBackendRenderTarget(desc);
570 } 570 }
571 571
572 /////////////////////////////////////////////////////////////////////////////// 572 ///////////////////////////////////////////////////////////////////////////////
573 573
574 bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params, 574 bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params,
575 int width, int height) const { 575 int width, int height) const {
576 const GrDrawTarget::Caps& caps = fGpu->getCaps(); 576 const GrDrawTarget::Caps* caps = fGpu->caps();
577 if (!caps.eightBitPaletteSupport()) { 577 if (!caps->eightBitPaletteSupport()) {
578 return false; 578 return false;
579 } 579 }
580 580
581 bool isPow2 = GrIsPow2(width) && GrIsPow2(height); 581 bool isPow2 = GrIsPow2(width) && GrIsPow2(height);
582 582
583 if (!isPow2) { 583 if (!isPow2) {
584 bool tiled = NULL != params && params->isTiled(); 584 bool tiled = NULL != params && params->isTiled();
585 if (tiled && !caps.npotTextureTileSupport()) { 585 if (tiled && !caps->npotTextureTileSupport()) {
586 return false; 586 return false;
587 } 587 }
588 } 588 }
589 return true; 589 return true;
590 } 590 }
591 591
592 //////////////////////////////////////////////////////////////////////////////// 592 ////////////////////////////////////////////////////////////////////////////////
593 593
594 const GrClipData* GrContext::getClip() const { 594 const GrClipData* GrContext::getClip() const {
595 return fGpu->getClip(); 595 return fGpu->getClip();
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 return srcTexture; 1807 return srcTexture;
1808 } 1808 }
1809 } 1809 }
1810 1810
1811 /////////////////////////////////////////////////////////////////////////////// 1811 ///////////////////////////////////////////////////////////////////////////////
1812 #if GR_CACHE_STATS 1812 #if GR_CACHE_STATS
1813 void GrContext::printCacheStats() const { 1813 void GrContext::printCacheStats() const {
1814 fTextureCache->printStats(); 1814 fTextureCache->printStats();
1815 } 1815 }
1816 #endif 1816 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698