Skip to content

Commit

Permalink
Remove all references of PAG headers from tgfx.
Browse files Browse the repository at this point in the history
  • Loading branch information
domchen committed Feb 18, 2022
1 parent c3fbf2e commit 534c42d
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 10 deletions.
1 change: 0 additions & 1 deletion tgfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ endif ()

# collects tgfx common files.
set(TGFX_INCLUDES ./ include src)
list(APPEND TGFX_INCLUDES ../ ../include ../src)
file(GLOB TGFX_FILES
src/core/*.*
src/core/utils/*.*
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tgfx/src/core/Bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "core/Bitmap.h"
#include "core/Image.h"
#include "platform/Platform.h"
#include "skcms.h"

namespace tgfx {
Expand Down
2 changes: 1 addition & 1 deletion tgfx/src/core/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "core/Image.h"
#include "base/utils/USE.h"
#include "core/Bitmap.h"
#include "core/ImageInfo.h"
#include "core/PixelBuffer.h"
#include "core/Stream.h"
#include "core/utils/USE.h"
#include "platform/NativeCodec.h"

#if defined(TGFX_USE_WEBP_DECODE) || defined(TGFX_USE_WEBP_ENCODE)
Expand Down
2 changes: 0 additions & 2 deletions tgfx/src/core/PixelBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "core/PixelBuffer.h"
#include "core/Bitmap.h"
#include "gpu/Device.h"
#include "platform/Platform.h"

namespace tgfx {
class RasterPixelBuffer : public PixelBuffer {
Expand Down
46 changes: 46 additions & 0 deletions tgfx/src/core/utils/USE.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Tencent is pleased to support the open source community by making libpag available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

namespace tgfx {

/**
* The USE(x, ...) template is used to silence C++ compiler warnings issued for (yet) unused
* variables (typically parameters).
*/

#if defined(_MSC_VER)
#define USE(expr) \
__pragma(warning(push)) /* Disable warning C4127: conditional expression is constant */ \
__pragma(warning(disable : 4127)) do { \
if (false) { \
(void)(expr); \
} \
} \
while (false) __pragma(warning(pop))
#else
#define USE(expr) \
do { \
if (false) { \
(void)(expr); \
} \
} while (false)
#endif

} // namespace tgfx
1 change: 0 additions & 1 deletion tgfx/src/core/vectors/coregraphics/CGScalerContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "core/vectors/coregraphics/CGScalerContext.h"
#include "base/utils/Interpolate.h"
#include "core/PathEffect.h"
#include "core/utils/Log.h"
#include "core/utils/MathExtra.h"
Expand Down
3 changes: 1 addition & 2 deletions tgfx/src/gpu/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "gpu/Context.h"
#include "base/utils/GetTimer.h"
#include "core/Performance.h"
#include "core/utils/Log.h"
#include "gpu/GradientCache.h"
#include "gpu/Program.h"
#include "gpu/ProgramCache.h"
#include "gpu/ResourceCache.h"

Expand Down
2 changes: 1 addition & 1 deletion tgfx/src/gpu/ResourceCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "ResourceCache.h"
#include "gpu/ResourceCache.h"
#include <unordered_map>
#include <unordered_set>
#include "core/BytesKey.h"
Expand Down
2 changes: 1 addition & 1 deletion tgfx/src/platform/apple/HardwareBuffer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "HardwareBuffer.h"
#include "base/utils/USE.h"
#include "core/utils/USE.h"

namespace tgfx {
static std::mutex cacheLocker = {};
Expand Down

0 comments on commit 534c42d

Please sign in to comment.