IWYU for tests starting with 'D'.

Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
Reviewed-on: https://skia-review.googlesource.com/129319
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2018-04-17 17:42:08 -04:00 committed by Skia Commit-Bot
parent f536c454bf
commit b5f2897ab5
19 changed files with 159 additions and 130 deletions

View File

@ -55,7 +55,6 @@ tests_sources = [
"$_tests/DequeTest.cpp",
"$_tests/DetermineDomainModeTest.cpp",
"$_tests/DeviceTest.cpp",
"$_tests/DFPathRendererTest.cpp",
"$_tests/DiscardableMemoryPoolTest.cpp",
"$_tests/DiscardableMemoryTest.cpp",
"$_tests/DrawBitmapRectTest.cpp",

View File

@ -12,7 +12,7 @@
#ifdef SK_VULKAN
#ifdef SK_VULKAN_HEADER
#include SK_VULKAN_HEADER
#include SK_VULKAN_HEADER // IWYU pragma: export
#else
// This is deprecated and all clients should define their own custum header shim that sets up
// defines and includes the vulkan.h header. Then they should define SK_VULKAN_HEADER or set the
@ -43,7 +43,7 @@
# define VK_NO_PROTOTYPES
# endif
# include <vulkan/vulkan.h>
# include <vulkan/vulkan.h> // IWYU pragma: export
#endif // SK_VULKAN_HEADER
#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17

View File

@ -8,6 +8,8 @@
#ifndef Skia_Vulkan_Android_DEFINED
#define Skia_Vulkan_Android_DEFINED
#include "SkTypes.h"
#if !defined(SK_BUILD_FOR_ANDROID)
#error "Must be building for android to use this header"
#endif
@ -15,7 +17,7 @@
# define VK_USE_PLATFORM_ANDROID_KHR
#endif
#include <vulkan/vulkan.h>
#include <vulkan/vulkan.h> // IWYU pragma: export
#endif

View File

@ -1,84 +0,0 @@
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkPath.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "ops/GrSmallPathRenderer.h"
#if 0
// This test case including path coords and matrix taken from crbug.com/627443.
// Because of inaccuracies in large floating point values this causes the
// the path renderer to attempt to add a path DF to its atlas that is larger
// than the plot size which used to crash rather than fail gracefully.
static void test_far_from_origin(GrContext* ctx, GrRenderTargetContext* renderTargetContext,
GrPathRenderer* pr) {
SkPath path;
path.lineTo(49.0255089839f, 0.473541f);
// This extra line wasn't in the original bug but was added to fake out GrShape's special
// handling of single line segments.
path.rLineTo(0.015f, 0.015f);
static constexpr SkScalar mvals[] = {14.0348252854f, 2.13026182736f,
13.6122547187f, 118.309922702f,
1912337682.09f, 2105391889.87f};
SkMatrix matrix;
matrix.setAffine(mvals);
SkMatrix inverse;
SkAssertResult(matrix.invert(&inverse));
path.transform(inverse);
SkStrokeRec rec(SkStrokeRec::kFill_InitStyle);
rec.setStrokeStyle(1.f);
rec.setStrokeParams(SkPaint::kRound_Cap, SkPaint::kRound_Join, 1.f);
GrStyle style(rec, nullptr);
GrShape shape(path, style);
shape = shape.applyStyle(GrStyle::Apply::kPathEffectAndStrokeRec, 1.f);
GrPaint paint;
paint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
GrNoClip noClip;
GrPathRenderer::DrawPathArgs args{ctx,
std::move(paint),
&GrUserStencilSettings::kUnused,
renderTargetContext,
&noClip,
&matrix,
&shape,
GrAAType::kCoverage,
false};
pr->drawPath(args);
}
DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(SmallPathRenderer, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
// The DF PR only works with contexts that support derivatives
if (!ctx->caps()->shaderCaps()->shaderDerivativeSupport()) {
return;
}
sk_sp<GrRenderTargetContext> rtc(ctx->makeRenderTargetContext(SkBackingFit::kApprox,
800, 800,
kRGBA_8888_GrPixelConfig,
nullptr,
0,
kTopLeft_GrSurfaceOrigin));
if (!rtc) {
return;
}
GrSmallPathRenderer spr;
ctx->flush();
test_far_from_origin(ctx, rtc.get(), &spr);
ctx->flush();
}
#endif
#endif

View File

@ -5,13 +5,21 @@
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkDashPathEffect.h"
#include "SkWriteBuffer.h"
#include "SkStrokeRec.h"
#include "SkCanvas.h"
#include "SkDashPathEffect.h"
#include "SkImageInfo.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPathEffect.h"
#include "SkPoint.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkScalar.h"
#include "SkStrokeRec.h"
#include "SkSurface.h"
#include "SkTypes.h"
#include "Test.h"
// crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unflatten itself when
// the effect is nonsense. Here we test that it fails when passed nonsense parameters.

View File

@ -9,12 +9,21 @@
#include "SkDataTable.h"
#include "SkOSFile.h"
#include "SkOSPath.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkRWBuffer.h"
#include "SkRefCnt.h"
#include "SkStream.h"
#include "SkString.h"
#include "SkTArray.h"
#include "SkTaskGroup.h"
#include "SkTemplates.h"
#include "SkTypes.h"
#include "Test.h"
#include <cstdio>
#include <cstring>
#include <memory>
#include <utility>
static void test_is_equal(skiatest::Reporter* reporter,
const SkDataTable* a, const SkDataTable* b) {
REPORTER_ASSERT(reporter, a->count() == b->count());
@ -201,7 +210,6 @@ DEF_TEST(Data, reporter) {
}
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "SkRWBuffer.h"
const char gABC[] = "abcdefghijklmnopqrstuvwxyz";
@ -251,8 +259,6 @@ static void check_alphabet_buffer(skiatest::Reporter* reporter, const SkROBuffer
check_abcs(reporter, storage.get(), size);
}
#include "SkTaskGroup.h"
DEF_TEST(RWBuffer, reporter) {
// Knowing that the default capacity is 4096, choose N large enough so we force it to use
// multiple buffers internally.

View File

@ -5,17 +5,34 @@
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkBitmap.h"
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrColor.h"
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextOptions.h"
#include "GrContextPriv.h"
#include "GrFragmentProcessor.h"
#include "GrPaint.h"
#include "GrRenderTargetContext.h"
#include "GrStyle.h"
#include "GrTypesPriv.h"
#include "SkBitmap.h"
#include "SkColor.h"
#include "SkColorSpace.h"
#include "SkImageInfo.h"
#include "SkMatrix.h"
#include "SkPath.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkStrokeRec.h"
#include "Test.h"
#include "effects/GrConstColorProcessor.h"
#include <utility>
static void only_allow_default(GrContextOptions* options) {
options->fGpuPathRenderers = GpuPathRenderers::kNone;
}

View File

@ -8,16 +8,31 @@
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrGLTypes.h"
#include "GrGpu.h"
#include "GrRenderTargetContext.h"
#include "GrRenderTargetProxy.h"
#include "GrTextureProxy.h"
#include "GrTextureProxyPriv.h"
#include "GrTypes.h"
#include "GrTypesPriv.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorSpacePriv.h"
#include "SkColorSpace.h"
#include "SkDeferredDisplayList.h"
#include "SkDeferredDisplayListRecorder.h"
#include "SkGpuDevice.h"
#include "SkImage.h"
#include "SkImageInfo.h"
#include "SkImage_Gpu.h"
#include "SkPaint.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkSurface.h"
#include "SkSurfaceCharacterization.h"
#include "SkSurfaceProps.h"
@ -25,10 +40,15 @@
#include "Test.h"
#include "gl/GrGLCaps.h"
#include "gl/GrGLDefines.h"
#ifdef SK_VULKAN
#include "vk/GrVkDefines.h"
#endif
#include <initializer_list>
#include <memory>
#include <utility>
// Try to create a backend format from the provided colorType and config. Return an invalid
// backend format if the combination is infeasible.
static GrBackendFormat create_backend_format(GrContext* context,

View File

@ -5,15 +5,23 @@
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
#include "GrSurfaceProxy.h"
#include "GrSamplerState.h"
#include "GrTextureProducer.h"
#include "GrTextureProxy.h"
#include "GrTypes.h"
#include "GrTypesPriv.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "Test.h"
#include <initializer_list>
// For DetermineDomainMode (in the MDB world) we have 3 rects:
// 1) the final instantiated backing storage (i.e., the actual GrTexture's extent)

View File

@ -5,16 +5,24 @@
* found in the LICENSE file.
*/
#include "SkBitmapDevice.h"
#include "SkBitmap.h"
#include "SkDevice.h"
#include "SkImage.h"
#include "SkImageInfo.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkSpecialImage.h"
#include "SkTypes.h"
#include "Test.h"
class SkColorSpace;
#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
#include "GrTypes.h"
#include "SkGpuDevice.h"
class GrContext;
#endif
#include "Test.h"
class DeviceTestingAccess {
public:
static sk_sp<SkSpecialImage> MakeSpecial(SkBaseDevice* dev, const SkBitmap& bm) {

View File

@ -4,10 +4,14 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkDiscardableMemoryPool.h"
#include "SkDiscardableMemory.h"
#include "SkDiscardableMemoryPool.h"
#include "SkRefCnt.h"
#include "Test.h"
#include <memory>
DEF_TEST(DiscardableMemoryPool, reporter) {
sk_sp<SkDiscardableMemoryPool> pool(SkDiscardableMemoryPool::Make(1));
pool->setRAMBudget(3);

View File

@ -5,10 +5,14 @@
* found in the LICENSE file.
*/
#include "SkDiscardableMemory.h"
#include "SkDiscardableMemoryPool.h"
#include "SkRefCnt.h"
#include "Test.h"
#include <cstring>
#include <memory>
namespace {
constexpr char kTestString[] = "HELLO, WORLD!";
constexpr size_t kTestStringLength = sizeof(kTestString);

View File

@ -7,16 +7,17 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkData.h"
#include "SkDiscardableMemoryPool.h"
#include "SkImageGenerator.h"
#include "SkColor.h"
#include "SkMatrix.h"
#include "SkMatrixUtils.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPixelRef.h"
#include "SkRandom.h"
#include "SkRect.h"
#include "SkScalar.h"
#include "SkShader.h"
#include "SkSurface.h"
#include "SkSize.h"
#include "SkTypes.h"
#include "Test.h"
///////////////////////////////////////////////////////////////////////////////

View File

@ -7,8 +7,10 @@
#include "SkCanvas.h"
#include "SkDrawFilter.h"
#include "SkRefCnt.h"
#include "SkSurface.h"
#include "Test.h"
class SkPaint;
#ifdef SK_SUPPORT_LEGACY_DRAWFILTER

View File

@ -8,10 +8,37 @@
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrDeferredUpload.h"
#include "GrDrawOpAtlas.h"
#include "GrDrawingManager.h"
#include "GrOnFlushResourceProvider.h"
#include "GrOpFlushState.h"
#include "GrRenderTargetContext.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTextureProxy.h"
#include "GrTypesPriv.h"
#include "GrXferProcessor.h"
#include "SkBitmap.h"
#include "SkColor.h"
#include "SkColorSpace.h"
#include "SkIPoint16.h"
#include "SkImageInfo.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPoint.h"
#include "SkRefCnt.h"
#include "Test.h"
#include "text/GrGlyphCache.h"
#include "ops/GrDrawOp.h"
#include "text/GrAtlasManager.h"
#include "text/GrAtlasTextContext.h"
#include "text/GrTextUtils.h"
#include <memory>
class GrResourceProvider;
static const int kNumPlots = 2;
static const int kPlotSize = 32;
@ -145,16 +172,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BasicDrawOpAtlas, reporter, ctxInfo) {
check(reporter, atlas.get(), 1, 4, 1);
}
#include "GrTest.h"
#include "GrDrawingManager.h"
#include "GrOpFlushState.h"
#include "GrProxyProvider.h"
#include "effects/GrConstColorProcessor.h"
#include "ops/GrAtlasTextOp.h"
#include "text/GrAtlasTextContext.h"
// This test verifies that the GrAtlasTextOp::onPrepare method correctly handles a failure
// when allocating an atlas page.
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrAtlasTextOpPreparation, reporter, ctxInfo) {

View File

@ -7,9 +7,21 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
#include "SkDashPathEffect.h"
#include "SkImageInfo.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPathEffect.h"
#include "SkPoint.h"
#include "SkRRect.h"
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkScalar.h"
#include "SkStrokeRec.h"
#include "SkSurface.h"
#include "SkTypes.h"
#include "Test.h"
// test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint)

View File

@ -20,7 +20,7 @@
#include "SkTypes.h"
#include "Test.h"
#include <math.h>
#include <cmath>
static const SkColor bgColor = SK_ColorWHITE;

View File

@ -6,8 +6,11 @@
*/
#include "SkTDynamicHash.h"
#include "SkTypes.h"
#include "Test.h"
#include <cstring>
namespace {
struct Entry {

View File

@ -8,6 +8,8 @@
#ifndef GrVulkanDefines_DEFINED
#define GrVulkanDefines_DEFINED
#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN)
# if !defined(VK_USE_PLATFORM_WIN32_KHR)
# define VK_USE_PLATFORM_WIN32_KHR
@ -28,6 +30,6 @@
#define VK_NO_PROTOTYPES
#endif
#include <vulkan/vulkan.h>
#include <vulkan/vulkan.h> // IWYU pragma: export
#endif