Add GrContext::setMaxTextureSizeOverride
https://codereview.chromium.org/20325002/ git-svn-id: http://skia.googlecode.com/svn/trunk@10358 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
a9b7936a72
commit
44a91dcf25
@ -253,6 +253,15 @@ public:
|
||||
*/
|
||||
int getMaxTextureSize() const;
|
||||
|
||||
/**
|
||||
* Temporarily override the true max texture size. Note: an override
|
||||
* larger then the true max texture size will have no effect.
|
||||
* This entry point is mainly meant for testing texture size dependent
|
||||
* features and is only available if defined outside of Skia (see
|
||||
* bleed GM.
|
||||
*/
|
||||
void setMaxTextureSizeOverride(int maxTextureSizeOverride);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Render targets
|
||||
|
||||
@ -871,7 +880,9 @@ private:
|
||||
void* fInfo;
|
||||
};
|
||||
|
||||
SkTDArray<CleanUpData> fCleanUpData;
|
||||
SkTDArray<CleanUpData> fCleanUpData;
|
||||
|
||||
int fMaxTextureSizeOverride;
|
||||
|
||||
GrContext(); // init must be called after the constructor.
|
||||
bool init(GrBackend, GrBackendContext);
|
||||
|
@ -102,6 +102,7 @@ GrContext::GrContext() {
|
||||
fAARectRenderer = NULL;
|
||||
fOvalRenderer = NULL;
|
||||
fViewMatrix.reset();
|
||||
fMaxTextureSizeOverride = 1 << 20;
|
||||
}
|
||||
|
||||
bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
|
||||
@ -554,7 +555,7 @@ void GrContext::setTextureCacheLimits(int maxTextures, size_t maxTextureBytes) {
|
||||
}
|
||||
|
||||
int GrContext::getMaxTextureSize() const {
|
||||
return fGpu->caps()->maxTextureSize();
|
||||
return GrMin(fGpu->caps()->maxTextureSize(), fMaxTextureSizeOverride);
|
||||
}
|
||||
|
||||
int GrContext::getMaxRenderTargetSize() const {
|
||||
|
Loading…
Reference in New Issue
Block a user