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

Side by Side Diff: services/gfx/compositor/render/render_frame.h

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_ 5 #ifndef SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_
6 #define SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_ 6 #define SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h" 10 #include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h"
11 #include "skia/ext/refptr.h"
12 #include "third_party/skia/include/core/SkRect.h" 11 #include "third_party/skia/include/core/SkRect.h"
12 #include "third_party/skia/include/core/SkRefCnt.h"
13 13
14 class SkCanvas; 14 class SkCanvas;
15 class SkPicture; 15 class SkPicture;
16 16
17 namespace compositor { 17 namespace compositor {
18 18
19 // Describes a frame to be rendered. 19 // Describes a frame to be rendered.
20 // 20 //
21 // Render objects are thread-safe, immutable, and reference counted. 21 // Render objects are thread-safe, immutable, and reference counted.
22 // They have no direct references to the scene graph. 22 // They have no direct references to the scene graph.
(...skipping 16 matching lines...) Expand all
39 mojo::gfx::composition::FrameInfo frame_info_; 39 mojo::gfx::composition::FrameInfo frame_info_;
40 int64_t composition_time_; 40 int64_t composition_time_;
41 }; 41 };
42 42
43 // Creates an empty render frame with no content. 43 // Creates an empty render frame with no content.
44 RenderFrame(const Metadata& metadata, const SkIRect& viewport); 44 RenderFrame(const Metadata& metadata, const SkIRect& viewport);
45 45
46 // Creates render frame backed by a picture. 46 // Creates render frame backed by a picture.
47 RenderFrame(const Metadata& metadata, 47 RenderFrame(const Metadata& metadata,
48 const SkIRect& viewport, 48 const SkIRect& viewport,
49 const skia::RefPtr<SkPicture>& picture); 49 const sk_sp<SkPicture>& picture);
50 50
51 // Gets metadata about the frame. 51 // Gets metadata about the frame.
52 const Metadata& metadata() const { return metadata_; } 52 const Metadata& metadata() const { return metadata_; }
53 53
54 // Gets the frame's viewport in pixels. 54 // Gets the frame's viewport in pixels.
55 const SkIRect& viewport() const { return viewport_; } 55 const SkIRect& viewport() const { return viewport_; }
56 56
57 // Gets the underlying picture to rasterize, or null if the frame is empty. 57 // Gets the underlying picture to rasterize, or null if the frame is empty.
58 const skia::RefPtr<SkPicture>& picture() const { return picture_; } 58 const sk_sp<SkPicture>& picture() const { return picture_; }
59 59
60 // Draws the contents of the frame to a canvas. 60 // Draws the contents of the frame to a canvas.
61 void Draw(SkCanvas* canvas) const; 61 void Draw(SkCanvas* canvas) const;
62 62
63 private: 63 private:
64 friend class base::RefCountedThreadSafe<RenderFrame>; 64 friend class base::RefCountedThreadSafe<RenderFrame>;
65 friend class RenderFrameBuilder; 65 friend class RenderFrameBuilder;
66 66
67 ~RenderFrame(); 67 ~RenderFrame();
68 68
69 Metadata metadata_; 69 Metadata metadata_;
70 SkIRect viewport_; 70 SkIRect viewport_;
71 skia::RefPtr<SkPicture> picture_; 71 sk_sp<SkPicture> picture_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(RenderFrame); 73 DISALLOW_COPY_AND_ASSIGN(RenderFrame);
74 }; 74 };
75 75
76 } // namespace compositor 76 } // namespace compositor
77 77
78 #endif // SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_ 78 #endif // SERVICES_GFX_COMPOSITOR_RENDER_RENDER_FRAME_H_
OLDNEW
« no previous file with comments | « services/gfx/compositor/graph/transform_pair.h ('k') | services/gfx/compositor/render/render_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698