• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // StreamProducerImpl.h: Defines the abstract rx::StreamProducerImpl class.
8 
9 #ifndef LIBANGLE_RENDERER_STREAMPRODUCERIMPL_H_
10 #define LIBANGLE_RENDERER_STREAMPRODUCERIMPL_H_
11 
12 #include "common/angleutils.h"
13 #include "libANGLE/Stream.h"
14 
15 namespace rx
16 {
17 
18 class StreamProducerImpl : angle::NonCopyable
19 {
20   public:
StreamProducerImpl()21     explicit StreamProducerImpl() {}
~StreamProducerImpl()22     virtual ~StreamProducerImpl() {}
23 
24     // Validates the ability for the producer to accept an arbitrary pointer to a frame. All
25     // pointers should be validated through this function before being used to produce a frame.
26     virtual egl::Error validateD3DTexture(const void *pointer,
27                                           const egl::AttributeMap &attributes) const = 0;
28 
29     // Constructs a frame from an arbitrary external pointer that points to producer specific frame
30     // data. Replaces the internal frame with the new one.
31     virtual void postD3DTexture(void *pointer, const egl::AttributeMap &attributes) = 0;
32 
33     // Returns an OpenGL texture interpretation of some frame attributes for the purpose of
34     // constructing an OpenGL texture from a frame. Depending on the producer and consumer, some
35     // frames may have multiple "planes" with different OpenGL texture representations.
36     virtual egl::Stream::GLTextureDescription getGLFrameDescription(int planeIndex) = 0;
37 };
38 }  // namespace rx
39 
40 #endif  // LIBANGLE_RENDERER_STREAMPRODUCERIMPL_H_
41