diff options
author | 2011-11-16 12:22:10 -0800 | |
---|---|---|
committer | 2011-11-16 12:22:10 -0800 | |
commit | 2d8ef49914595f3f1df42fed0a9ae68777ff9411 (patch) | |
tree | a7bd41b3a01cb9a824056fc04972ddb72e88ee31 /libs/rs/rsContext.cpp | |
parent | 7b95eba9f47a3992128d59a9ec593b887e4dac0e (diff) |
Fixing FBO font rendering bug that resulted from using old surface size.
Change-Id: I31d0967bb36ca6ffb6a4c8194597d3c523cfe954
Diffstat (limited to 'libs/rs/rsContext.cpp')
-rw-r--r-- | libs/rs/rsContext.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index f8213a1d2b11..293fc3ad953b 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -472,6 +472,30 @@ void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) { } } +uint32_t Context::getCurrentSurfaceWidth() const { + for (uint32_t i = 0; i < mFBOCache.mHal.state.colorTargetsCount; i ++) { + if (mFBOCache.mHal.state.colorTargets[i] != NULL) { + return mFBOCache.mHal.state.colorTargets[i]->getType()->getDimX(); + } + } + if (mFBOCache.mHal.state.depthTarget != NULL) { + return mFBOCache.mHal.state.depthTarget->getType()->getDimX(); + } + return mWidth; +} + +uint32_t Context::getCurrentSurfaceHeight() const { + for (uint32_t i = 0; i < mFBOCache.mHal.state.colorTargetsCount; i ++) { + if (mFBOCache.mHal.state.colorTargets[i] != NULL) { + return mFBOCache.mHal.state.colorTargets[i]->getType()->getDimY(); + } + } + if (mFBOCache.mHal.state.depthTarget != NULL) { + return mFBOCache.mHal.state.depthTarget->getType()->getDimY(); + } + return mHeight; +} + void Context::pause() { rsAssert(mIsGraphicsContext); mPaused = true; |