SkBlitRow.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2011 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkBlitRow_DEFINED
  8. #define SkBlitRow_DEFINED
  9. #include "include/core/SkBitmap.h"
  10. #include "include/core/SkColor.h"
  11. class SkBlitRow {
  12. public:
  13. enum Flags32 {
  14. kGlobalAlpha_Flag32 = 1 << 0,
  15. kSrcPixelAlpha_Flag32 = 1 << 1
  16. };
  17. /** Function pointer that blends 32bit colors onto a 32bit destination.
  18. @param dst array of dst 32bit colors
  19. @param src array of src 32bit colors (w/ or w/o alpha)
  20. @param count number of colors to blend
  21. @param alpha global alpha to be applied to all src colors
  22. */
  23. typedef void (*Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8CPU alpha);
  24. static Proc32 Factory32(unsigned flags32);
  25. /** Blend a single color onto a row of S32 pixels, writing the result
  26. into a row of D32 pixels. src and dst may be the same memory, but
  27. if they are not, they may not overlap.
  28. */
  29. static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMColor color);
  30. };
  31. #endif