• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
8 #include "SkPaintFlagsDrawFilter.h"
9 #include "SkPaint.h"
10 
SkPaintFlagsDrawFilter(uint32_t clearFlags,uint32_t setFlags)11 SkPaintFlagsDrawFilter::SkPaintFlagsDrawFilter(uint32_t clearFlags,
12                                                uint32_t setFlags) {
13     fClearFlags = SkToU16(clearFlags & SkPaint::kAllFlags);
14     fSetFlags = SkToU16(setFlags & SkPaint::kAllFlags);
15 }
16 
filter(SkPaint * paint,Type)17 bool SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
18     paint->setFlags((paint->getFlags() & ~fClearFlags) | fSetFlags);
19     return true;
20 }
21