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

Side by Side Diff: mojo/skia/ganesh_image_factory.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
« no previous file with comments | « mojo/skia/ganesh_framebuffer_surface.cc ('k') | mojo/skia/ganesh_image_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 MOJO_SKIA_GANESH_IMAGE_FACTORY_H_ 5 #ifndef MOJO_SKIA_GANESH_IMAGE_FACTORY_H_
6 #define MOJO_SKIA_GANESH_IMAGE_FACTORY_H_ 6 #define MOJO_SKIA_GANESH_IMAGE_FACTORY_H_
7 7
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 #include <GLES2/gl2extmojo.h> 9 #include <GLES2/gl2extmojo.h>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "mojo/skia/ganesh_context.h" 12 #include "mojo/skia/ganesh_context.h"
13 #include "skia/ext/refptr.h"
14 #include "third_party/skia/include/core/SkImageGenerator.h" 13 #include "third_party/skia/include/core/SkImageGenerator.h"
14 #include "third_party/skia/include/core/SkRefCnt.h"
15 #include "third_party/skia/include/gpu/GrTypes.h" 15 #include "third_party/skia/include/gpu/GrTypes.h"
16 16
17 class SkImage; 17 class SkImage;
18 18
19 namespace mojo { 19 namespace mojo {
20 namespace skia { 20 namespace skia {
21 21
22 // Creates an SkImage from a GL texture. 22 // Creates an SkImage from a GL texture.
23 // The underlying texture must be kept alive for as long as the SkImage exists. 23 // The underlying texture must be kept alive for as long as the SkImage exists.
24 // Invokes |release_callback| when the SkImage is deleted. 24 // Invokes |release_callback| when the SkImage is deleted.
25 ::skia::RefPtr<SkImage> CreateImageFromTexture( 25 sk_sp<SkImage> CreateImageFromTexture(const GaneshContext::Scope& scope,
26 const GaneshContext::Scope& scope, 26 uint32_t texture_id,
27 uint32_t texture_id, 27 uint32_t width,
28 uint32_t width, 28 uint32_t height,
29 uint32_t height, 29 GrSurfaceOrigin origin,
30 GrSurfaceOrigin origin, 30 const base::Closure& release_callback);
31 const base::Closure& release_callback);
32 31
33 // Generates backing content for SkImages from a texture mailbox. 32 // Generates backing content for SkImages from a texture mailbox.
34 // If |sync_point| is non-zero, inserts a sync point into the command stream 33 // If |sync_point| is non-zero, inserts a sync point into the command stream
35 // before the image is first drawn. 34 // before the image is first drawn.
36 // It is the responsibility of the client of this class to ensure that 35 // It is the responsibility of the client of this class to ensure that
37 // the mailbox name is valid at the time when the image is being drawn. 36 // the mailbox name is valid at the time when the image is being drawn.
38 class MailboxTextureImageGenerator : public SkImageGenerator { 37 class MailboxTextureImageGenerator : public SkImageGenerator {
39 public: 38 public:
40 MailboxTextureImageGenerator( 39 MailboxTextureImageGenerator(
41 const GLbyte mailbox_name[GL_MAILBOX_SIZE_CHROMIUM], 40 const GLbyte mailbox_name[GL_MAILBOX_SIZE_CHROMIUM],
42 GLuint sync_point, 41 GLuint sync_point,
43 uint32_t width, 42 uint32_t width,
44 uint32_t height, 43 uint32_t height,
45 GrSurfaceOrigin origin); 44 GrSurfaceOrigin origin);
46 ~MailboxTextureImageGenerator() override; 45 ~MailboxTextureImageGenerator() override;
47 46
48 GrTexture* onGenerateTexture(GrContext* context, 47 GrTexture* onGenerateTexture(GrContext* context,
49 const SkIRect* subset) override; 48 const SkIRect* subset) override;
50 49
51 private: 50 private:
52 GLbyte mailbox_name_[GL_MAILBOX_SIZE_CHROMIUM]; 51 GLbyte mailbox_name_[GL_MAILBOX_SIZE_CHROMIUM];
53 GLuint sync_point_; 52 GLuint sync_point_;
54 GrSurfaceOrigin origin_; 53 GrSurfaceOrigin origin_;
55 }; 54 };
56 55
57 } // namespace skia 56 } // namespace skia
58 } // namespace mojo 57 } // namespace mojo
59 58
60 #endif // MOJO_SKIA_GANESH_IMAGE_FACTORY_H_ 59 #endif // MOJO_SKIA_GANESH_IMAGE_FACTORY_H_
OLDNEW
« no previous file with comments | « mojo/skia/ganesh_framebuffer_surface.cc ('k') | mojo/skia/ganesh_image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698