skia2/tools/gpu/ProxyUtils.h
Robert Phillips 6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00

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