Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / gfx / webrender_bindings / RenderTextureHost.cpp
blob71391bd1f79c6680472c49f960af310c7c5a58b8
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"
9 #include "GLContext.h"
10 #include "RenderThread.h"
12 namespace mozilla {
13 namespace wr {
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,
21 LOCAL_GL_LINEAR);
22 aGL->fTexParameteri(aBindTarget, LOCAL_GL_TEXTURE_MAG_FILTER,
23 LOCAL_GL_LINEAR);
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,
36 gl::GLContext* aGL) {
37 return InvalidToWrExternalImage();
40 wr::WrExternalImage RenderTextureHost::LockSWGL(uint8_t aChannelIndex,
41 void* aContext,
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");
57 } // namespace wr
58 } // namespace mozilla