2016-11-04 15:59:10 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrTextureRenderTargetProxy_DEFINED
|
|
|
|
#define GrTextureRenderTargetProxy_DEFINED
|
|
|
|
|
|
|
|
#include "GrRenderTargetProxy.h"
|
|
|
|
#include "GrTextureProxy.h"
|
|
|
|
|
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
|
|
|
// Windows gives warnings about inheriting asTextureProxy/asRenderTargetProxy via dominance.
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable: 4250)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// This class delays the acquisition of RenderTargets that are also textures until
|
|
|
|
// they are actually required
|
|
|
|
// Beware: the uniqueID of the TextureRenderTargetProxy will usually be different than
|
|
|
|
// the uniqueID of the RenderTarget/Texture it represents!
|
|
|
|
class GrTextureRenderTargetProxy : public GrTextureProxy, public GrRenderTargetProxy {
|
|
|
|
private:
|
2016-11-09 11:50:43 +00:00
|
|
|
friend class GrSurfaceProxy; // for ctors
|
|
|
|
|
2016-11-04 15:59:10 +00:00
|
|
|
// Deferred version
|
|
|
|
GrTextureRenderTargetProxy(const GrCaps&, const GrSurfaceDesc&, SkBackingFit, SkBudgeted);
|
|
|
|
|
|
|
|
// Wrapped version
|
2016-11-09 11:50:43 +00:00
|
|
|
GrTextureRenderTargetProxy(sk_sp<GrSurface>);
|
2016-11-04 15:59:10 +00:00
|
|
|
|
|
|
|
size_t onGpuMemorySize() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|