Home | History | Annotate | Download | only in effects
      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 
     11 SkPaintFlagsDrawFilter::SkPaintFlagsDrawFilter(uint32_t clearFlags,
     12                                                uint32_t setFlags) {
     13     fClearFlags = SkToU16(clearFlags & SkPaint::kAllFlags);
     14     fSetFlags = SkToU16(setFlags & SkPaint::kAllFlags);
     15 }
     16 
     17 bool SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
     18     paint->setFlags((paint->getFlags() & ~fClearFlags) | fSetFlags);
     19     return true;
     20 }
     21