// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_GFX_GTK_UTIL_H_ #define BASE_GFX_GTK_UTIL_H_ #include #include typedef struct _GdkColor GdkColor; typedef struct _GdkRegion GdkRegion; // Define a macro for creating GdkColors from RGB values. This is a macro to // allow static construction of literals, etc. Use this like: // GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff); #define GDK_COLOR_RGB(r, g, b) {0, r * 257, g * 257, b * 257} namespace gfx { class Rect; extern const GdkColor kGdkWhite; extern const GdkColor kGdkBlack; extern const GdkColor kGdkGreen; // Modify the given region by subtracting the given rectangles. void SubtractRectanglesFromRegion(GdkRegion* region, const std::vector& cutouts); // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. // The caller is responsible for free()ing the data. If |stride| is 0, // it's assumed to be 4 * |width|. uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); } // namespace gfx #endif // BASE_GFX_GTK_UTIL_H_