1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TILES_RASTER_DARK_MODE_FILTER_H_
6 #define CC_TILES_RASTER_DARK_MODE_FILTER_H_
8 #include "cc/cc_export.h"
9 #include "third_party/skia/include/core/SkColorFilter.h"
10 #include "third_party/skia/include/core/SkPixmap.h"
14 // This class provides an interface/wrapper over blink::DarkModeFilter. The APIs
15 // in this interface are thread-safe and can be used concurrently from any
16 // thread. The interface would be created and destroyed on main thread. Derived
17 // classes should ensure making these APIs thread-safe.
18 class CC_EXPORT RasterDarkModeFilter {
20 virtual ~RasterDarkModeFilter() = default;
22 // Ensure pixmap has decoded data before calling this API.
23 virtual sk_sp<SkColorFilter> ApplyToImage(const SkPixmap& pixmap,
24 const SkIRect& src) const = 0;
29 #endif // CC_TILES_RASTER_DARK_MODE_FILTER_H_