skia2/tools/gpu/ProxyUtils.h
Brian Salomon e666254f0f Remove SkImage_Base::peekProxy.
This is the only place we provide a proxy from a SkImage other than
asView() and is only used in one place in the library. Add a utility
function to replace uses in tests based on asView().

Bug: skia:11208
Change-Id: Ica6eae6e5f153f208523331566acc0360925a20e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-23 19:59:31 +00:00

49 lines
1.7 KiB
C++

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef ProxyUtils_DEFINED
#define ProxyUtils_DEFINED
#include "include/private/GrTypesPriv.h"
#include "src/gpu/GrImageInfo.h"
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrTextureProxy.h"
class GrDirectContext;
class GrProgramInfo;
class GrPixmap;
namespace sk_gpu_test {
/** Returns the proxy backing an image if it is texture backed, otherwise nullptr. */
GrTextureProxy* GetTextureImageProxy(SkImage*, GrRecordingContext*);
/** Makes a texture proxy containing the passed in color data. */
GrSurfaceProxyView MakeTextureProxyViewFromData(GrDirectContext*,
GrRenderable,
GrSurfaceOrigin,
GrPixmap pixmap);
GrProgramInfo* CreateProgramInfo(const GrCaps*,
SkArenaAlloc*,
const GrSurfaceProxyView& writeView,
GrAppliedClip&&,
const GrXferProcessor::DstProxyView&,
GrGeometryProcessor*,
SkBlendMode,
GrPrimitiveType,
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp,
GrPipeline::InputFlags flags = GrPipeline::InputFlags::kNone,
const GrUserStencilSettings* stencil =
&GrUserStencilSettings::kUnused);
} // namespace sk_gpu_test
#endif