summaryrefslogtreecommitdiffstats
path: root/base/gfx/gtk_util.h
blob: bf6e6aa9f45f658a89261900c6e8c30d634f2009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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 <vector>

typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
class SkBitmap;

namespace gfx {

class Rect;

// Modify the given region by subtracting the given rectangles.
void SubtractRectanglesFromRegion(GdkRegion* region,
                                  const std::vector<gfx::Rect>& cutouts);

// Convert and copy a SkBitmap to a GdkPixbuf.  NOTE: This is an expensive
// operation, all of the pixels must be copied and their order swapped.
GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap);

}  // namespace gfx

#endif  // BASE_GFX_GTK_UTIL_H_