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

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: More style fixes, ran git cl format 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
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
abarth-chromium 2015/05/29 23:04:11 We usually omit this blank line.
jackson 2015/05/29 23:35:44 Acknowledged.
22 public:
23 ~CanvasImage() override {}
abarth-chromium 2015/05/29 23:04:11 Please move implementations of virtual function ou
jackson 2015/05/29 23:35:44 Acknowledged.
24 static PassRefPtr<CanvasImage> create() { return adoptRef(new CanvasImage); }
25
26 int width() const;
27 int height() const;
28
29 KURL src() const { return srcURL_; }
30 void setSrc(const String&);
31
32 SkBitmap bitmap() const { return bitmap_; }
abarth-chromium 2015/05/29 23:04:11 const SkBitmap&
jackson 2015/05/29 23:35:44 Acknowledged.
33 void setBitmap(const SkBitmap& bitmap) { bitmap_ = bitmap; }
34
35 private:
36 CanvasImage() : imageLoader_(NewImageLoader::create(this)) {}
abarth-chromium 2015/05/29 23:04:11 I'd move this out-of-line as well.
jackson 2015/05/29 23:35:44 Acknowledged.
37
38 // NewImageLoaderClient
39 void notifyLoadFinished(const SkBitmap& result);
abarth-chromium 2015/05/29 23:04:11 override.
jackson 2015/05/29 23:35:44 Acknowledged.
40
41 KURL srcURL_;
42 SkBitmap bitmap_;
43 OwnPtr<NewImageLoader> imageLoader_;
44 };
45
46 } // namespace blink
47
48 #endif // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698