aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTexturePriv.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-09-30 06:58:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-30 06:58:20 -0700
commitb06e5a2f558133b865cb0c3cc0b36e9bd2e594e2 (patch)
tree52a68d8103a78776d05f5c933b4f715dd7828633 /src/gpu/GrTexturePriv.h
parentdbe6074a06efc5fb6883bb5e4f251ed67c8c0ab4 (diff)
Revert of Make "priv" classes for GrTexure and GrSurface. (patchset #9 id:260001 of https://codereview.chromium.org/596053002/)
Reason for revert: Breaking the Chrome builds with: lib/libcc.so: error: undefined reference to 'GrAutoScratchTexture::detach()' (http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2990/steps/Retry_BuildContentShell_1/logs/stdio) Original issue's description: > Make "priv" classes for GrTexure and GrSurface. R=egdaniel@google.com, joshualitt@google.com, bsalomon@google.com TBR=bsalomon@google.com, egdaniel@google.com, joshualitt@google.com NOTREECHECKS=true NOTRY=true Author: robertphillips@google.com Review URL: https://codereview.chromium.org/618733002
Diffstat (limited to 'src/gpu/GrTexturePriv.h')
-rw-r--r--src/gpu/GrTexturePriv.h82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/gpu/GrTexturePriv.h b/src/gpu/GrTexturePriv.h
deleted file mode 100644
index 9a3e0e215b..0000000000
--- a/src/gpu/GrTexturePriv.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrTexturePriv_DEFINED
-#define GrTexturePriv_DEFINED
-
-#include "GrTexture.h"
-
-/** Class that adds methods to GrTexture that are only intended for use internal to Skia.
- This class is purely a privileged window into GrTexture. It should never have additional data
- members or virtual methods.
- Non-static methods that are not trivial inlines should be spring-boarded (e.g. declared and
- implemented privately in GrTexture with a inline public method here). */
-class GrTexturePriv {
-public:
- void setFlag(GrTextureFlags flags) {
- fTexture->fDesc.fFlags = fTexture->fDesc.fFlags | flags;
- }
-
- void resetFlag(GrTextureFlags flags) {
- fTexture->fDesc.fFlags = fTexture->fDesc.fFlags & ~flags;
- }
-
- bool isSetFlag(GrTextureFlags flags) const {
- return 0 != (fTexture->fDesc.fFlags & flags);
- }
-
- void dirtyMipMaps(bool mipMapsDirty) { fTexture->dirtyMipMaps(mipMapsDirty); }
-
- bool mipMapsAreDirty() const {
- return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus;
- }
-
- bool hasMipMaps() const {
- return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatus;
- }
-
- static GrResourceKey ComputeKey(const GrGpu* gpu,
- const GrTextureParams* params,
- const GrTextureDesc& desc,
- const GrCacheID& cacheID);
- static GrResourceKey ComputeScratchKey(const GrTextureDesc& desc);
- static bool NeedsResizing(const GrResourceKey& key);
- static bool NeedsBilerp(const GrResourceKey& key);
-
-
- // TODO: Move this logic and the shift values out of here and to the callers.
- SkFixed normalizeFixedX(SkFixed x) const {
- SkASSERT(SkIsPow2(fTexture->fDesc.fWidth));
- return x >> fTexture->fShiftFixedX;
- }
-
- SkFixed normalizeFixedY(SkFixed y) const {
- SkASSERT(SkIsPow2(fTexture->fDesc.fHeight));
- return y >> fTexture->fShiftFixedY;
- }
-
-private:
- GrTexturePriv(GrTexture* texture) : fTexture(texture) { }
- GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { }
- GrTexturePriv& operator=(const GrTexturePriv&); // unimpl
-
- // No taking addresses of this type.
- const GrTexturePriv* operator&() const;
- GrTexturePriv* operator&();
-
- GrTexture* fTexture;
-
- friend class GrTexture; // to construct/copy this type.
-};
-
-inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); }
-
-inline const GrTexturePriv GrTexture::texturePriv () const {
- return GrTexturePriv(const_cast<GrTexture*>(this));
-}
-
-#endif