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

Side by Side Diff: sky/engine/core/painting/CanvasImage.h

Issue 1151753009: Add Sky framework support for drawing images (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Run git cl format once more Created 5 years, 6 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 | « sky/engine/core/painting/Canvas.idl ('k') | sky/engine/core/painting/CanvasImage.cpp » ('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 2013 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 SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_
6 #define SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_
7
8 #include "sky/engine/core/loader/NewImageLoader.h"
9 #include "sky/engine/platform/weborigin/KURL.h"
10 #include "sky/engine/tonic/dart_wrappable.h"
11 #include "sky/engine/wtf/PassRefPtr.h"
12 #include "sky/engine/wtf/text/AtomicString.h"
13 #include "third_party/skia/include/core/SkBitmap.h"
14
15 namespace blink {
16
17 class CanvasImage final : public RefCounted<CanvasImage>,
18 public DartWrappable,
19 public NewImageLoaderClient {
20 DEFINE_WRAPPERTYPEINFO();
21 public:
22 ~CanvasImage() override;
23 static PassRefPtr<CanvasImage> create() { return adoptRef(new CanvasImage); }
24
25 int width() const;
26 int height() const;
27
28 KURL src() const { return srcURL_; }
29 void setSrc(const String&);
30
31 const SkBitmap& bitmap() const { return bitmap_; }
32 void setBitmap(const SkBitmap& bitmap) { bitmap_ = bitmap; }
33
34 private:
35 CanvasImage();
36
37 // NewImageLoaderClient
38 void OnLoadFinished(const SkBitmap& result) override;
39
40 KURL srcURL_;
41 SkBitmap bitmap_;
42 OwnPtr<NewImageLoader> imageLoader_;
43 };
44
45 } // namespace blink
46
47 #endif // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Canvas.idl ('k') | sky/engine/core/painting/CanvasImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698