diff options
author | John Reck <jreck@google.com> | 2012-05-29 21:01:30 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-29 21:01:30 -0700 |
commit | cbfe85d221255eaee1424b1a2f79be6166523bc4 (patch) | |
tree | 6304fb3457ed72ee03193bc3c142833c73579855 /Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp | |
parent | cff29754c2515b04a1241a8acb205db466d6a4e3 (diff) | |
parent | 1d51221cb2f00354a8d78776caaaa04347e9b61b (diff) | |
download | external_webkit-cbfe85d221255eaee1424b1a2f79be6166523bc4.zip external_webkit-cbfe85d221255eaee1424b1a2f79be6166523bc4.tar.gz external_webkit-cbfe85d221255eaee1424b1a2f79be6166523bc4.tar.bz2 |
am 1d51221c: am 4a0b0816: Merge "Don\'t use setupPaintFill for drawBitmap" into jb-dev
* commit '1d51221cb2f00354a8d78776caaaa04347e9b61b':
Don't use setupPaintFill for drawBitmap
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp index 944dc98..3b37693 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp @@ -231,6 +231,16 @@ void PlatformGraphicsContext::setAlpha(float alpha) m_state->alpha = alpha; } +int PlatformGraphicsContext::getNormalizedAlpha() const +{ + int alpha = roundf(m_state->alpha * 256); + if (alpha > 255) + alpha = 255; + else if (alpha < 0) + alpha = 0; + return alpha; +} + void PlatformGraphicsContext::setCompositeOperation(CompositeOperator op) { m_state->mode = WebCoreCompositeToSkiaComposite(op); |