skia2/tools/gpu/ProxyUtils.h
Greg Daniel f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00

49 lines
2.1 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/GrTextureProxy.h"
namespace sk_gpu_test {
/** Makes a texture proxy containing the passed in color data. */
sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext*, GrRenderable, int width, int height,
GrColorType, GrSRGBEncoded, GrSurfaceOrigin,
const void* data, size_t rowBytes);
/** Version that takes GrColorType rather than SkColorType and assumes GrSRGBEncoded::kNo. */
inline sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext* context,
GrRenderable renderable, int width,
int height, GrColorType grCT,
GrSurfaceOrigin origin, const void* data,
size_t rowBytes) {
return MakeTextureProxyFromData(context, renderable, width, height,
grCT, GrSRGBEncoded::kNo, origin, data, rowBytes);
}
/** Version that takes SkColorType rather than GrColorType and assumes GrSRGBEncoded::kNo. */
inline sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext* context,
GrRenderable renderable, int width,
int height, SkColorType ct,
GrSurfaceOrigin origin, const void* data,
size_t rowBytes) {
GrColorType grCT = SkColorTypeToGrColorType(ct);
if (GrColorType::kUnknown == grCT) {
return nullptr;
}
return MakeTextureProxyFromData(context, renderable, width, height,
grCT, GrSRGBEncoded::kNo, origin, data, rowBytes);
}
} // namespace sk_gpu_test
#endif