Guest User

Untitled

a guest
May 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
  2. index 439a99f..5d6b786 100644
  3. --- a/WebCore/ChangeLog
  4. +++ b/WebCore/ChangeLog
  5. @@ -1,3 +1,12 @@
  6. +2010-07-27 Andreas Kling <andreas.kling@nokia.com>
  7. +
  8. + Reviewed by NOBODY (OOPS!).
  9. +
  10. + [Qt] putImageData(): Fast premultiply() if alpha == 255
  11. +
  12. + * platform/graphics/qt/ImageBufferQt.cpp:
  13. + (WebCore::premultiply): Do nothing for opaque pixels.
  14. +
  15. 2010-07-27 Simon Fraser <simon.fraser@apple.com>
  16.  
  17. Reviewed by Darin Adler.
  18. diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
  19. index bd272db..e0e2de6 100644
  20. --- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
  21. +++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
  22. @@ -240,6 +240,8 @@ PassRefPtr<ImageData> ImageBuffer::getPremultipliedImageData(const IntRect& rect
  23. static inline unsigned int premultiply(unsigned int x)
  24. {
  25. unsigned int a = x >> 24;
  26. + if (a == 255)
  27. + return x;
  28. unsigned int t = (x & 0xff00ff) * a;
  29. t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
  30. t &= 0xff00ff;
Add Comment
Please, Sign In to add comment