diff options
author | robertphillips <robertphillips@google.com> | 2014-09-30 06:58:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-30 06:58:20 -0700 |
commit | b06e5a2f558133b865cb0c3cc0b36e9bd2e594e2 (patch) | |
tree | 52a68d8103a78776d05f5c933b4f715dd7828633 /src/gpu/GrSurfacePriv.h | |
parent | dbe6074a06efc5fb6883bb5e4f251ed67c8c0ab4 (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/GrSurfacePriv.h')
-rw-r--r-- | src/gpu/GrSurfacePriv.h | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/gpu/GrSurfacePriv.h b/src/gpu/GrSurfacePriv.h deleted file mode 100644 index 3203671fad..0000000000 --- a/src/gpu/GrSurfacePriv.h +++ /dev/null @@ -1,63 +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 GrSurfacePriv_DEFINED -#define GrSurfacePriv_DEFINED - -#include "GrSurface.h" - -/** Class that adds methods to GrSurface that are only intended for use internal to Skia. - This class is purely a privileged window into GrSurface. 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 GrSurface with a inline public method here). */ -class GrSurfacePriv { -public: - /** - * Derive a SkImageInfo from the surface's descriptor. This is lossy as ImageInfo has fields not - * known to GrSurface (e.g. alphaType). - */ - SkImageInfo info() const { return fSurface->info(); } - - /** - * Checks whether this GrSurface refers to the same GPU object as other. This - * catches the case where a GrTexture and GrRenderTarget refer to the same - * GPU memory. - */ - bool isSameAs(const GrSurface* other) const { return fSurface->isSameAs(other); } - - /** - * Write the contents of the surface to a PNG. Returns true if successful. - * @param filename Full path to desired file - */ - bool savePixels(const char* filename) { return fSurface->savePixels(filename); } - - bool hasPendingRead() const { return fSurface->hasPendingRead(); } - bool hasPendingWrite() const { return fSurface->hasPendingWrite(); } - bool hasPendingIO() const { return fSurface->hasPendingIO(); } - -private: - GrSurfacePriv(GrSurface* surface) : fSurface(surface) { } - GrSurfacePriv(const GrSurfacePriv& that) : fSurface(that.fSurface) { } - GrSurfacePriv& operator=(const GrSurface&); // unimpl - - // No taking addresses of this type. - const GrSurfacePriv* operator&() const; - GrSurfacePriv* operator&(); - - GrSurface* fSurface; - - friend class GrSurface; // to construct/copy this type. -}; - -inline GrSurfacePriv GrSurface::surfacePriv() { return GrSurfacePriv(this); } - -inline const GrSurfacePriv GrSurface::surfacePriv() const { - return GrSurfacePriv(const_cast<GrSurface*>(this)); -} - -#endif |