• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright 2011 Google Inc.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 
10 #include "SkPaintFlagsDrawFilter.h"
11 #include "SkPaint.h"
12 
SkPaintFlagsDrawFilter(uint32_t clearFlags,uint32_t setFlags)13 SkPaintFlagsDrawFilter::SkPaintFlagsDrawFilter(uint32_t clearFlags,
14                                                uint32_t setFlags) {
15     fClearFlags = SkToU16(clearFlags & SkPaint::kAllFlags);
16     fSetFlags = SkToU16(setFlags & SkPaint::kAllFlags);
17 }
18 
filter(SkPaint * paint,Type)19 void SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
20     paint->setFlags((paint->getFlags() & ~fClearFlags) | fSetFlags);
21 }
22 
23