Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / gfx / nine_image_painter.h
blob46458d5cb284e9b775cefee13743a77c346acd80
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_GFX_NINE_IMAGE_PAINTER_H_
6 #define UI_GFX_NINE_IMAGE_PAINTER_H_
8 #include "base/logging.h"
9 #include "ui/gfx/gfx_export.h"
10 #include "ui/gfx/image/image_skia.h"
12 namespace gfx {
14 class Canvas;
15 class Insets;
16 class Rect;
18 class GFX_EXPORT NineImagePainter {
19 public:
20 explicit NineImagePainter(const std::vector<ImageSkia>& images);
21 NineImagePainter(const ImageSkia& image, const Insets& insets);
22 ~NineImagePainter();
24 bool IsEmpty() const;
25 Size GetMinimumSize() const;
26 void Paint(Canvas* canvas, const Rect& bounds);
27 void Paint(Canvas* canvas, const Rect& bounds, uint8 alpha);
29 private:
30 // Images are numbered as depicted below.
31 // ____________________
32 // |__i0__|__i1__|__i2__|
33 // |__i3__|__i4__|__i5__|
34 // |__i6__|__i7__|__i8__|
35 ImageSkia images_[9];
37 DISALLOW_COPY_AND_ASSIGN(NineImagePainter);
40 } // namespace gfx
42 #endif // UI_GFX_NINE_IMAGE_PAINTER_H_