[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - external/skia RepositoryExternal.mk vcl/opengl vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 26 10:50:59 UTC 2020
RepositoryExternal.mk | 1 +
external/skia/Library_skia.mk | 2 ++
external/skia/inc/skia_compiler.hxx | 13 +++++++++++++
external/skia/source/skia_compiler.cxx | 20 ++++++++++++++++++++
vcl/opengl/win/WinDeviceInfo.cxx | 2 +-
vcl/skia/SkiaHelper.cxx | 15 ++++-----------
6 files changed, 41 insertions(+), 12 deletions(-)
New commits:
commit f43fcef36a08da5adf630df8ade8f5b3a210581b
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Thu Jun 25 10:35:00 2020 +0200
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Jun 26 12:50:20 2020 +0200
log properly the compiler used to compile Skia
Using #define's directly from VCL will report the compiler used
to compile VCL, which may be different from the one used for Skia.
Also truncate the log file on opening.
Change-Id: Iddf613613df20505f1abe1dd5468dcc8c7041410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97090
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
(cherry picked from commit 014916c7c76cfaf9baa3f76a2169ba8343f0cfbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97135
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index e052d70d5136..e534c9d0ee6c 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -131,6 +131,7 @@ $(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,skia)/include/third_party/vulkan \
-I$(call gb_UnpackedTarball_get_dir,skia)/tools/gpu \
-I$(call gb_UnpackedTarball_get_dir,skia) \
+ -I$(SRCDIR)/external/skia/inc/ \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_libraries,$(1),skia)
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 62fdeffed46e..47140da4e50e 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -85,10 +85,12 @@ $(eval $(call gb_Library_set_include,skia,\
-I$(call gb_UnpackedTarball_get_dir,skia)/include/third_party/skcms/ \
-I$(call gb_UnpackedTarball_get_dir,skia)/third_party/vulkanmemoryallocator/ \
-I$(call gb_UnpackedTarball_get_dir,skia)/include/third_party/vulkan/ \
+ -I$(SRCDIR)/external/skia/inc/ \
))
$(eval $(call gb_Library_add_exception_objects,skia,\
external/skia/source/SkMemory_malloc \
+ external/skia/source/skia_compiler \
))
$(eval $(call gb_Library_set_generated_cxx_suffix,skia,cpp))
diff --git a/external/skia/inc/skia_compiler.hxx b/external/skia/inc/skia_compiler.hxx
new file mode 100644
index 000000000000..a26ec29bdd1e
--- /dev/null
+++ b/external/skia/inc/skia_compiler.hxx
@@ -0,0 +1,13 @@
+/*
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SKIA_COMPILER_H
+#define SKIA_COMPILER_H
+
+#include <include/core/SkTypes.h>
+
+SK_API const char* skia_compiler_name();
+
+#endif
diff --git a/external/skia/source/skia_compiler.cxx b/external/skia/source/skia_compiler.cxx
new file mode 100644
index 000000000000..6339a4a4f900
--- /dev/null
+++ b/external/skia/source/skia_compiler.cxx
@@ -0,0 +1,20 @@
+/*
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <skia_compiler.hxx>
+
+// Get the type of compiler that Skia is compiled with.
+const char* skia_compiler_name()
+{
+#if defined __clang__
+ return "Clang";
+#elif defined __GNUC__
+ return "GCC";
+#elif defined _MSC_VER
+ return "MSVC";
+#else
+ return "?";
+#endif
+}
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index 3fb4035ec58c..9ea39abd8b43 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -219,7 +219,7 @@ bool WinOpenGLDeviceInfo::isDeviceBlocked()
OUString aCacheFolder = getCacheFolder();
OUString aCacheFile(aCacheFolder + "/opengl_device.log");
- SvFileStream aOpenGLLogFile(aCacheFile, StreamMode::WRITE);
+ SvFileStream aOpenGLLogFile(aCacheFile, StreamMode::WRITE|StreamMode::TRUNC);
writeToLog(aOpenGLLogFile, "DriverVersion", maDriverVersion);
writeToLog(aOpenGLLogFile, "DriverDate", maDriverDate);
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 5fec448830c7..e31540ae449c 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -36,6 +36,7 @@ bool isVCLSkiaEnabled() { return false; }
#include <SkCanvas.h>
#include <SkPaint.h>
#include <SkSurface.h>
+#include <skia_compiler.hxx>
#ifdef DBG_UTIL
#include <fstream>
@@ -109,7 +110,7 @@ static bool isVulkanBlacklisted(const VkPhysicalDeviceProperties& props)
CrashReporter::addKeyValue("VulkanDeviceName", OUString::createFromAscii(props.deviceName),
CrashReporter::Write);
- SvFileStream logFile(getCacheFolder() + "/skia.log", StreamMode::WRITE);
+ SvFileStream logFile(getCacheFolder() + "/skia.log", StreamMode::WRITE | StreamMode::TRUNC);
writeToLog(logFile, "RenderMethod", "vulkan");
writeToLog(logFile, "Vendor", vendorIdStr);
writeToLog(logFile, "Device", deviceIdStr);
@@ -131,18 +132,10 @@ static bool isVulkanBlacklisted(const VkPhysicalDeviceProperties& props)
static void writeSkiaRasterInfo()
{
- SvFileStream logFile(getCacheFolder() + "/skia.log", StreamMode::WRITE);
+ SvFileStream logFile(getCacheFolder() + "/skia.log", StreamMode::WRITE | StreamMode::TRUNC);
writeToLog(logFile, "RenderMethod", "raster");
// Log compiler, Skia works best when compiled with Clang.
-#if defined __clang__
- writeToLog(logFile, "Compiler", "Clang");
-#elif defined __GNUC__
- writeToLog(logFile, "Compiler", "GCC");
-#elif defined _MSC_VER
- writeToLog(logFile, "Compiler", "MSVC");
-#else
- writeToLog(logFile, "Compiler", "?");
-#endif
+ writeToLog(logFile, "Compiler", skia_compiler_name());
}
static sk_app::VulkanWindowContext::SharedGrContext getTemporaryGrContext();
More information about the Libreoffice-commits
mailing list