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

Side by Side Diff: skia/ext/cdl_picture.h

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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 | « skia/ext/cdl_paint.cc ('k') | skia/ext/cdl_picture.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) 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 SKIA_EXT_CDL_PICTURE_H_
6 #define SKIA_EXT_CDL_PICTURE_H_
7
8 #include "cdl_common.h"
9
10 #if CDL_ENABLED
11
12 #include <stddef.h>
13 #include <stdint.h>
14
15 #include "base/compiler_specific.h"
16 #include "cdl_canvas.h"
17 #include "third_party/skia/include/core/SkCanvas.h"
18 #include "third_party/skia/include/core/SkPicture.h"
19 #include "third_party/skia/include/core/SkDrawable.h"
20
21 class CdlPictureBuffer;
22
23 class SK_API CdlPicture : public SkRefCnt {
24 public:
25 CdlPicture(sk_sp<CdlPictureBuffer> dl,
26 SkRect cull_bounds,
27 int start_offset,
28 int end_offset);
29 ~CdlPicture() override;
30
31 void draw(CdlCanvas* canvas,
32 const SkMatrix* matrix,
33 const CdlPaint* paint) const;
34
35 sk_sp<SkPicture> toSkPicture() const;
36 int approximateOpCount() const { return 1; }
37 void playback(CdlCanvas*, SkPicture::AbortCallback* = NULL) const;
38 SkRect cullRect() const { return cull_bounds_; }
39 uint32_t uniqueID() const;
40
41 private:
42 sk_sp<CdlPictureBuffer> picture_;
43 SkRect cull_bounds_;
44 int start_offset_;
45 int end_offset_;
46 mutable uint32_t unique_id_ = 0;
47 };
48
49 inline sk_sp<SkPicture> ToSkPicture(CdlPicture* picture) {
50 return picture->toSkPicture();
51 }
52
53 inline sk_sp<const SkPicture> ToSkPicture(const CdlPicture* picture) {
54 return picture->toSkPicture();
55 }
56
57 #else
58
59 #include "third_party/skia/include/core/SkPicture.h"
60
61 inline sk_sp<SkPicture> ToSkPicture(CdlPicture* picture) {
62 return sk_sp<SkPicture>(picture);
63 }
64
65 inline sk_sp<const SkPicture> ToSkPicture(const CdlPicture* picture) {
66 return sk_sp<const SkPicture>(picture);
67 }
68
69 #endif // CDL_ENABLED
70
71 #endif // SKIA_EXT_CDL_PICTURE_H_
OLDNEW
« no previous file with comments | « skia/ext/cdl_paint.cc ('k') | skia/ext/cdl_picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698