Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: ui/gfx/image/canvas_image_source.h

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/image/OWNERS ('k') | ui/gfx/image/canvas_image_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #ifndef UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_
6 #define UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/gfx/gfx_export.h"
11 #include "ui/gfx/image/image_skia_source.h"
12 #include "ui/gfx/size.h"
13
14 namespace gfx {
15 class Canvas;
16 class ImageSkiaRep;
17
18 // CanvasImageSource is useful if you need to generate an image for
19 // a scale factor using gfx::Canvas. It creates a new Canvas
20 // with target scale factor and generates ImageSkiaRep when drawing is
21 // completed.
22 class GFX_EXPORT CanvasImageSource : public gfx::ImageSkiaSource {
23 public:
24 CanvasImageSource(const gfx::Size& size, bool is_opaque);
25
26 // Called when a new image needs to be drawn for a scale factor.
27 virtual void Draw(gfx::Canvas* canvas) = 0;
28
29 // Returns the size of images in DIP that this source will generate.
30 const gfx::Size& size() const { return size_; };
31
32 // Overridden from gfx::ImageSkiaSource.
33 gfx::ImageSkiaRep GetImageForScale(float scale) override;
34
35 protected:
36 ~CanvasImageSource() override {}
37
38 const gfx::Size size_;
39 const bool is_opaque_;
40 DISALLOW_COPY_AND_ASSIGN(CanvasImageSource);
41 };
42
43 } // namespace gfx
44
45 #endif // UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_
OLDNEW
« no previous file with comments | « ui/gfx/image/OWNERS ('k') | ui/gfx/image/canvas_image_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698