Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: include/gpu/SkGrPixelRef.h

Issue 611383003: Revert of GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkGrPixelRef_DEFINED 8 #ifndef SkGrPixelRef_DEFINED
9 #define SkGrPixelRef_DEFINED 9 #define SkGrPixelRef_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 typedef SkPixelRef INHERITED; 34 typedef SkPixelRef INHERITED;
35 }; 35 };
36 36
37 /** 37 /**
38 * PixelRef that wraps a GrSurface 38 * PixelRef that wraps a GrSurface
39 */ 39 */
40 class SK_API SkGrPixelRef : public SkROLockPixelsPixelRef { 40 class SK_API SkGrPixelRef : public SkROLockPixelsPixelRef {
41 public: 41 public:
42 SK_DECLARE_INST_COUNT(SkGrPixelRef) 42 SK_DECLARE_INST_COUNT(SkGrPixelRef)
43 /** 43 /**
44 * Constructs a pixel ref around a GrSurface. 44 * Constructs a pixel ref around a GrSurface. If the caller has locked the G rSurface in the
45 * cache and would like the pixel ref to unlock it in its destructor then tr ansferCacheLock
46 * should be set to true.
45 */ 47 */
46 SkGrPixelRef(const SkImageInfo&, GrSurface*); 48 SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false) ;
47 virtual ~SkGrPixelRef(); 49 virtual ~SkGrPixelRef();
48 50
49 // override from SkPixelRef 51 // override from SkPixelRef
50 virtual GrTexture* getTexture() SK_OVERRIDE; 52 virtual GrTexture* getTexture() SK_OVERRIDE;
51 53
52 protected: 54 protected:
53 // overrides from SkPixelRef 55 // overrides from SkPixelRef
54 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE; 56 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE;
55 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE ; 57 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE ;
56 58
57 private: 59 private:
58 GrSurface* fSurface; 60 GrSurface* fSurface;
61 bool fUnlock; // if true the pixel ref owns a texture cache lock on fSurface
62
59 typedef SkROLockPixelsPixelRef INHERITED; 63 typedef SkROLockPixelsPixelRef INHERITED;
60 }; 64 };
61 65
62 #endif 66 #endif
OLDNEW
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698