Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.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 // An ImageSkiaSource that uses | |
|
pkotwicz
2012/07/10 21:44:29
Finish comment
| |
| 19 class CanvasImageSource : public gfx::ImageSkiaSource { | |
| 20 public: | |
| 21 CanvasImageSource(const gfx::Size& size, bool is_opaque); | |
| 22 | |
| 23 virtual void Draw(gfx::Canvas* canvas) = 0; | |
| 24 | |
| 25 const gfx::Size& size() const { return size_; }; | |
| 26 | |
| 27 // Overridden from gfx::ImageSkiaSource. | |
| 28 virtual gfx::ImageSkiaRep GetImageForScale( | |
| 29 ui::ScaleFactor scale_factor) OVERRIDE; | |
| 30 | |
| 31 protected: | |
| 32 virtual ~CanvasImageSource() {} | |
| 33 | |
| 34 const gfx::Size size_; | |
| 35 const bool is_opaque_; | |
| 36 DISALLOW_COPY_AND_ASSIGN(CanvasImageSource); | |
| 37 }; | |
| 38 | |
| 39 } // namespace gfx | |
| 40 | |
| 41 #endif // UI_GFX_IMAGE_CANVAS_IMAGE_SOURCE_H_ | |
| OLD | NEW |