OSDN Git Service

Remove vasurface.
authorKalyan Kondapally <kalyan.kondapally@intel.com>
Wed, 20 Dec 2017 01:41:34 +0000 (17:41 -0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Wed, 20 Dec 2017 23:19:47 +0000 (15:19 -0800)
This is just a dummy class doing nothing. Instead just use
NativeSurface.

Jira: None.
Test: Build compiles on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
14 files changed:
common/Android.mk
common/Makefile.sources
common/compositor/compositordefs.h
common/compositor/factory.cpp
common/compositor/nativesurface.h
common/compositor/va/varenderer.cpp
common/compositor/va/varenderer.h
common/compositor/va/vasurface.cpp [deleted file]
common/compositor/va/vasurface.h [deleted file]
common/compositor/va/vautils.cpp
os/android/platformdefines.h
os/platformcommondefines.h
wsi/Android.mk
wsi/drm/drmbuffer.cpp

index ccde0e4..3de0cce 100644 (file)
@@ -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 \
index 11bfe58..84f735e 100644 (file)
@@ -42,6 +42,5 @@ vk_SOURCES =\
 
 va_SOURCES =\
     compositor/va/varenderer.cpp \
-    compositor/va/vasurface.cpp \
     compositor/va/vautils.cpp \
        $(NULL)
index b537efc..f94e559 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <platformdefines.h>
 
+#include <va/va.h>
+
 namespace hwcomposer {
 
 // clang-format off
index 5180c97..812223c 100644 (file)
@@ -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() {
index f8ef12e..866316b 100644 (file)
@@ -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_;
index 7dda65f..52185d9 100644 (file)
@@ -25,7 +25,9 @@
 #include "overlaybuffer.h"
 #include "renderstate.h"
 
-#include "vasurface.h"
+#ifdef ANDROID
+#include <va/va_android.h>
+#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<float>& source_crop = layer_in->GetSourceCrop();
   surface_region.x = static_cast<int>(source_crop.left);
   surface_region.y = static_cast<int>(source_crop.top);
index db6be85..4fbdaeb 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "vautils.h"
 
-#include <platformdefines.h>
+#include <va/va.h>
 
 namespace hwcomposer {
 
diff --git a/common/compositor/va/vasurface.cpp b/common/compositor/va/vasurface.cpp
deleted file mode 100644 (file)
index 0277f0b..0000000
+++ /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 (file)
index 2d9ca2f..0000000
+++ /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_
index edbac63..232e9a0 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "vautils.h"
 
-#include <platformdefines.h>
+#include <va/va.h>
 
 #include <drm_fourcc.h>
 
index bd945ac..590a9cb 100644 (file)
@@ -32,7 +32,6 @@
 #include <ui/GraphicBuffer.h>
 #include "platformcommondefines.h"
 #include <cros_gralloc_handle.h>
-#include <va/va_android.h>
 
 #define DRV_I915 1
 #include <i915_private_android_types.h>
index 2fc1569..d9d63f7 100644 (file)
@@ -27,9 +27,6 @@ VkFormat NativeToVkFormat(int native_format);
 
 #include <xf86drm.h>
 #include <xf86drmMode.h>
-#include <va/va.h>
-#include <va/va_vpp.h>
-#include <va/va_drmcommon.h>
 
 #define DRM_FORMAT_NONE fourcc_code('0', '0', '0', '0')
 
index 52f7cd2..2d3bdbf 100644 (file)
@@ -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
index 79a6020..a7acd9b 100644 (file)
@@ -28,6 +28,8 @@
 #include "resourcemanager.h"
 #include "vautils.h"
 
+#include <va/va_drmcommon.h>
+
 namespace hwcomposer {
 
 DrmBuffer::~DrmBuffer() {