OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 #ifndef MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_CONSUMER_ENDPOINT_H_ | |
5 #define MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_CONSUMER_ENDPOINT_H_ | |
6 | |
7 #include "image_pipe_endpoint.h" | |
8 #include "mojo/public/c/system/macros.h" | |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | |
10 #include "mojo/services/gfx/images/cpp/image_pipe_consumer_delegate.h" | |
11 #include "mojo/services/gfx/images/interfaces/image_pipe.mojom.h" | |
12 | |
13 namespace image_pipe { | |
14 | |
15 class ImagePipeConsumerEndpoint : private mojo::gfx::ImagePipe { | |
jeffbrown
2016/03/03 23:27:49
public
nit: add docs
Forrest Reiling
2016/03/04 21:04:27
Done.
| |
16 public: | |
17 ImagePipeConsumerEndpoint( | |
18 mojo::InterfaceRequest<mojo::gfx::ImagePipe> request, | |
19 mojo::gfx::SupportedImagePropertiesPtr supported_properties, | |
jeffbrown
2016/03/03 23:27:49
remove this
Forrest Reiling
2016/03/04 21:04:27
Done.
| |
20 ImagePipeConsumerDelegate* delegate); | |
21 ~ImagePipeConsumerEndpoint() override; | |
22 | |
23 // Different methods for selecting images out of the pipe based on various | |
24 // selection policies. If no images are available that match the selection | |
25 // criteria the calls will return false otherwise they will write the selected | |
26 // id into their id argument and return true | |
jeffbrown
2016/03/03 23:27:49
dead? delete this comment
Forrest Reiling
2016/03/04 21:04:27
merged with below comment
| |
27 | |
28 // Aquire the Image presented least recently (queue like behavior). | |
29 bool AcquireNextImage(uint32_t* id); | |
jeffbrown
2016/03/03 23:27:49
nit: out_id
Forrest Reiling
2016/03/04 21:04:27
Done.
| |
30 | |
31 // Releases an image back to the producer | |
jeffbrown
2016/03/03 23:27:49
nit: period at end of sentences
Forrest Reiling
2016/03/04 21:04:27
Done.
| |
32 void ReleaseImage(uint32_t id, mojo::gfx::PresentationStatus status); | |
33 | |
34 void SetSupportedImageProperties( | |
jeffbrown
2016/03/03 23:27:49
delete this
Forrest Reiling
2016/03/04 21:04:27
Done.
| |
35 mojo::gfx::SupportedImagePropertiesPtr supported_properties); | |
36 | |
37 // For testing only, makes fatal errors not quite fatal, which allows tests | |
38 // to cause a fatal error and check that it was caught correctly without | |
39 // dying a horrible death in the process. If you are using this for something | |
40 // other than testing you are probably doing something very wrong. | |
41 void DisableFatalErrorsForTesting(); | |
jeffbrown
2016/03/03 23:27:49
Consider removing this ForTesting() stuff if you c
Forrest Reiling
2016/03/04 21:04:27
Acknowledged.
| |
42 | |
43 private: | |
44 void CloseEndpoint(); | |
45 | |
46 // Inherited from mojo::gfx::ImagePipe, see image_pipe.mojom for comments | |
47 void AddImage(mojo::gfx::ImagePtr image, uint32_t id) override; | |
48 void RemoveImage(uint32_t id) override; | |
49 void PresentImage(uint32_t id, const PresentImageCallback& callback) override; | |
50 void FlushImages() override; | |
51 void GetSupportedImageProperties( | |
52 const GetSupportedImagePropertiesCallback& callback) override; | |
53 | |
54 ImagePipeEndpoint state_tracker_; | |
55 ImagePipeConsumerDelegate* delegate_; | |
56 mojo::gfx::SupportedImagePropertiesPtr supported_properties_; | |
57 bool supported_properties_dirty_; | |
58 GetSupportedImagePropertiesCallback supported_properties_callback_; | |
59 bool supported_properties_callback_pending_; | |
60 | |
61 mojo::Binding<mojo::gfx::ImagePipe> image_pipe_binding_; | |
62 | |
63 MOJO_DISALLOW_COPY_AND_ASSIGN(ImagePipeConsumerEndpoint); | |
64 }; | |
65 | |
66 } // namespace image_pipe | |
67 | |
68 #endif // MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_CONSUMER_ENDPOINT_H_ | |
OLD | NEW |