1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "RenderTextureHost.h"
10 #include "RenderThread.h"
15 void ActivateBindAndTexParameteri(gl::GLContext
* aGL
, GLenum aActiveTexture
,
16 GLenum aBindTarget
, GLuint aBindTexture
) {
17 aGL
->fActiveTexture(aActiveTexture
);
18 aGL
->fBindTexture(aBindTarget
, aBindTexture
);
19 // Initialize the mip filters to linear by default.
20 aGL
->fTexParameteri(aBindTarget
, LOCAL_GL_TEXTURE_MIN_FILTER
,
22 aGL
->fTexParameteri(aBindTarget
, LOCAL_GL_TEXTURE_MAG_FILTER
,
26 RenderTextureHost::RenderTextureHost() : mIsFromDRMSource(false) {
27 MOZ_COUNT_CTOR(RenderTextureHost
);
30 RenderTextureHost::~RenderTextureHost() {
31 MOZ_ASSERT(RenderThread::IsInRenderThread());
32 MOZ_COUNT_DTOR(RenderTextureHost
);
35 wr::WrExternalImage
RenderTextureHost::Lock(uint8_t aChannelIndex
,
37 return InvalidToWrExternalImage();
40 wr::WrExternalImage
RenderTextureHost::LockSWGL(uint8_t aChannelIndex
,
42 RenderCompositor
* aCompositor
) {
43 return InvalidToWrExternalImage();
46 std::pair
<gfx::Point
, gfx::Point
> RenderTextureHost::GetUvCoords(
47 gfx::IntSize aTextureSize
) const {
48 return std::make_pair(gfx::Point(0.0, 0.0),
49 gfx::Point(static_cast<float>(aTextureSize
.width
),
50 static_cast<float>(aTextureSize
.height
)));
53 void RenderTextureHost::Destroy() {
54 MOZ_ASSERT_UNREACHABLE("unexpected to be called");
58 } // namespace mozilla