Hash :
ba887d90
Author :
Date :
2015-01-20T13:54:30
Store mShareHandle in SurfaceD3D. The type of the share handle depends on the implementation. BUG=angle:658 Change-Id: Id801f3d0c1e3def7cae5cbd88e7a7032b2f6d8fa Reviewed-on: https://chromium-review.googlesource.com/242050 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// SurfaceImpl.h: Implementation methods of egl::Surface
#ifndef LIBANGLE_RENDERER_SURFACEIMPL_H_
#define LIBANGLE_RENDERER_SURFACEIMPL_H_
#include "common/angleutils.h"
#include "libANGLE/Error.h"
namespace egl
{
class Display;
struct Config;
}
namespace rx
{
class SurfaceImpl
{
public:
SurfaceImpl(egl::Display *display, const egl::Config *config,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType);
virtual ~SurfaceImpl();
virtual egl::Error initialize() = 0;
virtual egl::Error swap() = 0;
virtual egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) = 0;
virtual egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) = 0;
virtual egl::Error bindTexImage(EGLint buffer) = 0;
virtual egl::Error releaseTexImage(EGLint buffer) = 0;
virtual void setSwapInterval(EGLint interval) = 0;
//TODO(jmadill): Possibly should be redesigned
virtual EGLNativeWindowType getWindowHandle() const = 0;
// width and height can change with client window resizing
virtual EGLint getWidth() const = 0;
virtual EGLint getHeight() const = 0;
const egl::Config *getConfig() const { return mConfig; }
EGLint isFixedSize() const { return mFixedSize; }
EGLenum getFormat() const;
EGLint isPostSubBufferSupported() const { return mPostSubBufferSupported; }
EGLenum getTextureFormat() const { return mTextureFormat; }
EGLenum getTextureTarget() const { return mTextureTarget; }
protected:
// Useful for mocking
SurfaceImpl()
: mDisplay(nullptr),
mConfig(nullptr),
mFixedSize(0),
mPostSubBufferSupported(0),
mTextureFormat(EGL_NONE),
mTextureTarget(EGL_NONE)
{}
egl::Display *const mDisplay;
const egl::Config *mConfig; // EGL config surface was created with
EGLint mFixedSize;
EGLint mPostSubBufferSupported;
// EGLint horizontalResolution; // Horizontal dot pitch
// EGLint verticalResolution; // Vertical dot pitch
// EGLBoolean largestPBuffer; // If true, create largest pbuffer possible
// EGLBoolean mipmapTexture; // True if texture has mipmaps
// EGLint mipmapLevel; // Mipmap level to render to
// EGLenum multisampleResolve; // Multisample resolve behavior
EGLenum mTextureFormat; // Format of texture: RGB, RGBA, or no texture
EGLenum mTextureTarget; // Type of texture: 2D or no texture
// EGLenum vgAlphaFormat; // Alpha format for OpenVG
// EGLenum vgColorSpace; // Color space for OpenVG
private:
DISALLOW_COPY_AND_ASSIGN(SurfaceImpl);
};
}
#endif // LIBANGLE_RENDERER_SURFACEIMPL_H_