ARTBrush.h 906 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <CoreGraphics/CoreGraphics.h>
  8. #import <Foundation/Foundation.h>
  9. @interface ARTBrush : NSObject
  10. /* @abstract */
  11. - (instancetype)initWithArray:(NSArray *)data NS_DESIGNATED_INITIALIZER;
  12. /**
  13. * For certain brushes we can fast path a combined fill and stroke.
  14. * For those brushes we override applyFillColor which sets the fill
  15. * color to be used by those batch paints. Those return YES.
  16. * We can't batch gradient painting in CoreGraphics, so those will
  17. * return NO and paint gets called instead.
  18. * @abstract
  19. */
  20. - (BOOL)applyFillColor:(CGContextRef)context;
  21. /**
  22. * paint fills the context with a brush. The context is assumed to
  23. * be clipped.
  24. * @abstract
  25. */
  26. - (void)paint:(CGContextRef)context;
  27. @end