diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-04-06 11:35:50 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-04-06 14:03:59 -0700 |
commit | 2e510fd5b5a30f1315c272d44ae3aa4cba355498 (patch) | |
tree | db3af5f32855d329856f190c3509ae11ae519851 /Source/WebCore/platform/graphics/android/MediaTexture.h | |
parent | c88c88907b618e468ec3928b06a3a31d4f99b9c6 (diff) | |
download | external_webkit-2e510fd5b5a30f1315c272d44ae3aa4cba355498.zip external_webkit-2e510fd5b5a30f1315c272d44ae3aa4cba355498.tar.gz external_webkit-2e510fd5b5a30f1315c272d44ae3aa4cba355498.tar.bz2 |
Reorganize platform/graphics/android
Change-Id: Idc67155cfa99784dcd931e705336bfa063ecae46
Diffstat (limited to 'Source/WebCore/platform/graphics/android/MediaTexture.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/MediaTexture.h | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.h b/Source/WebCore/platform/graphics/android/MediaTexture.h deleted file mode 100644 index 9ea7be2..0000000 --- a/Source/WebCore/platform/graphics/android/MediaTexture.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MediaTexture_h -#define MediaTexture_h - -#if USE(ACCELERATED_COMPOSITING) - -#include "RefPtr.h" -#include "LayerAndroid.h" -#include "Vector.h" -#include <GLES2/gl2.h> -#include <ui/GraphicBuffer.h> -#include <utils/RefBase.h> -#include <jni.h> - -namespace android { - class SurfaceTexture; -} - -namespace WebCore { - -typedef void (*FramerateCallbackProc)(ANativeWindow* window, int64_t timestamp); - -class MediaListener; - -class MediaTexture : public android::LightRefBase<MediaTexture> { - -public: - MediaTexture(jobject webViewRef, jobject webViewCoreRef); - ~MediaTexture(); - - bool isContentInverted(); - void invertContents(bool invertContent); - - void initNativeWindowIfNeeded(); - void draw(const TransformationMatrix& contentMatrix, - const TransformationMatrix& videoMatrix, - const SkRect& mediaBounds); - - ANativeWindow* getNativeWindowForContent(); - ANativeWindow* requestNativeWindowForVideo(); - - void releaseNativeWindow(const ANativeWindow* window); - void setDimensions(const ANativeWindow* window, const SkRect& dimensions); - void setFramerateCallback(const ANativeWindow* window, - FramerateCallbackProc callback); - -private: - struct TextureWrapper { - GLuint textureId; - sp<android::SurfaceTexture> surfaceTexture; - sp<ANativeWindow> nativeWindow; - sp<MediaListener> mediaListener; - SkRect dimensions; // only used by the video layer - }; - - TextureWrapper* createTexture(); - void deleteTexture(TextureWrapper* item, bool force = false); - - TextureWrapper* m_contentTexture; - Vector<TextureWrapper*> m_videoTextures; - Vector<GLuint> m_unusedTextures; - - // used to track if the content is to be drawn inverted - bool m_isContentInverted; - - // used to generate new video textures - bool m_newWindowRequest; - sp<ANativeWindow> m_newWindow; - - jobject m_weakWebViewRef; - jobject m_weakWebViewCoreRef; - - android::Mutex m_mediaLock; - android::Condition m_newMediaRequestCond; -}; - - -} // namespace WebCore - -#endif // USE(ACCELERATED_COMPOSITING) - -#endif // MediaTexture_h |