From: Kalyan Kondapally Date: Wed, 20 Dec 2017 01:41:34 +0000 (-0800) Subject: Remove vasurface. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f6c5be32f64055567b18654e8dc7100e0bf20730;p=android-x86%2Fexternal-IA-Hardware-Composer.git Remove vasurface. This is just a dummy class doing nothing. Instead just use NativeSurface. Jira: None. Test: Build compiles on Android. Signed-off-by: Kalyan Kondapally --- diff --git a/common/Android.mk b/common/Android.mk index ccde0e4..3de0cce 100644 --- a/common/Android.mk +++ b/common/Android.mk @@ -68,7 +68,6 @@ LOCAL_SRC_FILES := \ compositor/factory.cpp \ compositor/nativesurface.cpp \ compositor/renderstate.cpp \ - compositor/va/vasurface.cpp \ compositor/va/varenderer.cpp \ compositor/va/vautils.cpp \ core/gpudevice.cpp \ diff --git a/common/Makefile.sources b/common/Makefile.sources index 11bfe58..84f735e 100644 --- a/common/Makefile.sources +++ b/common/Makefile.sources @@ -42,6 +42,5 @@ vk_SOURCES =\ va_SOURCES =\ compositor/va/varenderer.cpp \ - compositor/va/vasurface.cpp \ compositor/va/vautils.cpp \ $(NULL) diff --git a/common/compositor/compositordefs.h b/common/compositor/compositordefs.h index b537efc..f94e559 100644 --- a/common/compositor/compositordefs.h +++ b/common/compositor/compositordefs.h @@ -27,6 +27,8 @@ #include +#include + namespace hwcomposer { // clang-format off diff --git a/common/compositor/factory.cpp b/common/compositor/factory.cpp index 5180c97..812223c 100644 --- a/common/compositor/factory.cpp +++ b/common/compositor/factory.cpp @@ -28,7 +28,6 @@ #endif #include "va/varenderer.h" -#include "va/vasurface.h" namespace hwcomposer { @@ -43,7 +42,7 @@ NativeSurface* Create3DBuffer(uint32_t width, uint32_t height) { } NativeSurface* CreateVideoBuffer(uint32_t width, uint32_t height) { - return new VASurface(width, height); + return new NativeSurface(width, height); } Renderer* Create3DRenderer() { diff --git a/common/compositor/nativesurface.h b/common/compositor/nativesurface.h index f8ef12e..866316b 100644 --- a/common/compositor/nativesurface.h +++ b/common/compositor/nativesurface.h @@ -42,7 +42,9 @@ class NativeSurface { bool InitializeForOffScreenRendering(HWCNativeHandle native_handle, ResourceManager* resource_manager); - virtual bool MakeCurrent() = 0; + virtual bool MakeCurrent() { + return false; + } int GetWidth() const { return width_; diff --git a/common/compositor/va/varenderer.cpp b/common/compositor/va/varenderer.cpp index 7dda65f..52185d9 100644 --- a/common/compositor/va/varenderer.cpp +++ b/common/compositor/va/varenderer.cpp @@ -25,7 +25,9 @@ #include "overlaybuffer.h" #include "renderstate.h" -#include "vasurface.h" +#ifdef ANDROID +#include +#endif #define ANDROID_DISPLAY_HANDLE 0x18C34078 #define UNUSED(x) (void*)(&x) @@ -144,7 +146,7 @@ bool VARenderer::Draw(const MediaState& state, NativeSurface* surface) { } // Get Output Surface. - OverlayLayer* layer_out = surface->GetLayer(); + const OverlayLayer* layer_out = surface->GetLayer(); const MediaResourceHandle& out_resource = layer_out->GetBuffer()->GetMediaResource( va_display_, layer_out->GetSourceCropWidth(), @@ -156,7 +158,7 @@ bool VARenderer::Draw(const MediaState& state, NativeSurface* surface) { } VARectangle surface_region; - OverlayLayer* layer_in = state.layer_; + const OverlayLayer* layer_in = state.layer_; const HwcRect& source_crop = layer_in->GetSourceCrop(); surface_region.x = static_cast(source_crop.left); surface_region.y = static_cast(source_crop.top); diff --git a/common/compositor/va/varenderer.h b/common/compositor/va/varenderer.h index db6be85..4fbdaeb 100644 --- a/common/compositor/va/varenderer.h +++ b/common/compositor/va/varenderer.h @@ -24,7 +24,7 @@ #include "vautils.h" -#include +#include namespace hwcomposer { diff --git a/common/compositor/va/vasurface.cpp b/common/compositor/va/vasurface.cpp deleted file mode 100644 index 0277f0b..0000000 --- a/common/compositor/va/vasurface.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -// Copyright (c) 2017 Intel Corporation -// -// 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. -*/ - -#include "vasurface.h" - -#include "overlaybuffer.h" - -namespace hwcomposer { - -VASurface::VASurface(uint32_t width, uint32_t height) - : NativeSurface(width, height) { -} - -VASurface::~VASurface() { -} - -bool VASurface::MakeCurrent() { - return true; -} - -} // namespace hwcomposer diff --git a/common/compositor/va/vasurface.h b/common/compositor/va/vasurface.h deleted file mode 100644 index 2d9ca2f..0000000 --- a/common/compositor/va/vasurface.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -// Copyright (c) 2016 Intel Corporation -// -// 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 COMMON_COMPOSITOR_VA_VASURFACE_H_ -#define COMMON_COMPOSITOR_VA_VASURFACE_H_ - -#include "nativesurface.h" - -namespace hwcomposer { - -class VASurface : public NativeSurface { - public: - VASurface() = default; - ~VASurface() override; - VASurface(uint32_t width, uint32_t height); - - bool MakeCurrent() override; -}; - -} // namespace hwcomposer -#endif // COMMON_COMPOSITOR_VA_VASURFACE_H_ diff --git a/common/compositor/va/vautils.cpp b/common/compositor/va/vautils.cpp index edbac63..232e9a0 100644 --- a/common/compositor/va/vautils.cpp +++ b/common/compositor/va/vautils.cpp @@ -16,7 +16,7 @@ #include "vautils.h" -#include +#include #include diff --git a/os/android/platformdefines.h b/os/android/platformdefines.h index bd945ac..590a9cb 100644 --- a/os/android/platformdefines.h +++ b/os/android/platformdefines.h @@ -32,7 +32,6 @@ #include #include "platformcommondefines.h" #include -#include #define DRV_I915 1 #include diff --git a/os/platformcommondefines.h b/os/platformcommondefines.h index 2fc1569..d9d63f7 100644 --- a/os/platformcommondefines.h +++ b/os/platformcommondefines.h @@ -27,9 +27,6 @@ VkFormat NativeToVkFormat(int native_format); #include #include -#include -#include -#include #define DRM_FORMAT_NONE fourcc_code('0', '0', '0', '0') diff --git a/wsi/Android.mk b/wsi/Android.mk index 52f7cd2..2d3bdbf 100644 --- a/wsi/Android.mk +++ b/wsi/Android.mk @@ -40,7 +40,8 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../os \ $(LOCAL_PATH)/../os/android \ $(LOCAL_PATH)/../wsi \ - $(LOCAL_PATH)/../wsi/drm + $(LOCAL_PATH)/../wsi/drm \ + $(TARGET_OUT_HEADERS)/libva LOCAL_SHARED_LIBRARIES += \ libva diff --git a/wsi/drm/drmbuffer.cpp b/wsi/drm/drmbuffer.cpp index 79a6020..a7acd9b 100644 --- a/wsi/drm/drmbuffer.cpp +++ b/wsi/drm/drmbuffer.cpp @@ -28,6 +28,8 @@ #include "resourcemanager.h" #include "vautils.h" +#include + namespace hwcomposer { DrmBuffer::~DrmBuffer() {