Chromium Code Reviews| Index: ui/gfx/image/canvas_image_source.h |
| diff --git a/ui/gfx/image/canvas_image_source.h b/ui/gfx/image/canvas_image_source.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..abe6e5b89ad60a5543ea115ab06c105abfd154af |
| --- /dev/null |
| +++ b/ui/gfx/image/canvas_image_source.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2012 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 UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_ |
| +#define UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_ |
| +#pragma once |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "ui/gfx/image/image_skia_source.h" |
| +#include "ui/gfx/size.h" |
| + |
| +namespace gfx { |
| +class Canvas; |
| +class ImageSkiaRep; |
| + |
| +// An ImageSkiaSource that uses |
|
pkotwicz
2012/07/10 21:44:29
Finish comment
|
| +class CanvasImageSource : public gfx::ImageSkiaSource { |
| + public: |
| + CanvasImageSource(const gfx::Size& size, bool is_opaque); |
| + |
| + virtual void Draw(gfx::Canvas* canvas) = 0; |
| + |
| + const gfx::Size& size() const { return size_; }; |
| + |
| + // Overridden from gfx::ImageSkiaSource. |
| + virtual gfx::ImageSkiaRep GetImageForScale( |
| + ui::ScaleFactor scale_factor) OVERRIDE; |
| + |
| + protected: |
| + virtual ~CanvasImageSource() {} |
| + |
| + const gfx::Size size_; |
| + const bool is_opaque_; |
| + DISALLOW_COPY_AND_ASSIGN(CanvasImageSource); |
| +}; |
| + |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_ |