blob: bc2dafe47dc8a28011859bd338e659804ce8f2a9 [file] [log] [blame]
Brian Salomon58389b92018-03-07 13:01:25 -05001/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef ProxyUtils_DEFINED
9#define ProxyUtils_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/private/GrTypesPriv.h"
Brian Salomon4eda7102019-10-21 15:04:52 -040012#include "src/gpu/GrImageInfo.h"
Robert Phillips34cea002019-11-21 16:02:34 -050013#include "src/gpu/GrPipeline.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040014#include "src/gpu/GrTextureProxy.h"
Brian Salomon58389b92018-03-07 13:01:25 -050015
Robert Phillips00f78de2020-07-01 16:09:43 -040016class GrDirectContext;
Robert Phillips34cea002019-11-21 16:02:34 -050017class GrProgramInfo;
Brian Salomon5392c942021-03-30 16:14:37 -040018class GrCPixmap;
Robert Phillips34cea002019-11-21 16:02:34 -050019
Brian Salomon58389b92018-03-07 13:01:25 -050020namespace sk_gpu_test {
21
Brian Salomone6662542021-02-23 10:45:39 -050022/** Returns the proxy backing an image if it is texture backed, otherwise nullptr. */
23GrTextureProxy* GetTextureImageProxy(SkImage*, GrRecordingContext*);
24
Brian Salomon58389b92018-03-07 13:01:25 -050025/** Makes a texture proxy containing the passed in color data. */
Brian Salomon652124c2020-08-12 14:06:50 -040026GrSurfaceProxyView MakeTextureProxyViewFromData(GrDirectContext*,
27 GrRenderable,
28 GrSurfaceOrigin,
Brian Salomon5392c942021-03-30 16:14:37 -040029 GrCPixmap pixmap);
Brian Salomon58389b92018-03-07 13:01:25 -050030
Robert Phillips34cea002019-11-21 16:02:34 -050031GrProgramInfo* CreateProgramInfo(const GrCaps*,
32 SkArenaAlloc*,
Adlai Hollere2296f72020-11-19 13:41:26 -050033 const GrSurfaceProxyView& writeView,
Robert Phillips34cea002019-11-21 16:02:34 -050034 GrAppliedClip&&,
John Stiles52cb1d02021-06-02 11:58:05 -040035 const GrDstProxyView&,
Robert Phillipsac6156c2020-02-28 16:02:40 -050036 GrGeometryProcessor*,
37 SkBlendMode,
Robert Phillips34cea002019-11-21 16:02:34 -050038 GrPrimitiveType,
Greg Danield358cbe2020-09-11 09:33:54 -040039 GrXferBarrierFlags renderPassXferBarriers,
Greg Daniel42dbca52020-11-20 10:22:43 -050040 GrLoadOp colorLoadOp,
Robert Phillips34cea002019-11-21 16:02:34 -050041 GrPipeline::InputFlags flags = GrPipeline::InputFlags::kNone,
42 const GrUserStencilSettings* stencil =
43 &GrUserStencilSettings::kUnused);
44
45
Brian Salomon58389b92018-03-07 13:01:25 -050046} // namespace sk_gpu_test
47
48#endif