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

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

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo 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. If the caller has locked the G rSurface in the 44 * Constructs a pixel ref around a GrSurface.
45 * cache and would like the pixel ref to unlock it in its destructor then tr ansferCacheLock
46 * should be set to true.
47 */ 45 */
48 SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false) ; 46 SkGrPixelRef(const SkImageInfo&, GrSurface*);
49 virtual ~SkGrPixelRef(); 47 virtual ~SkGrPixelRef();
50 48
51 // override from SkPixelRef 49 // override from SkPixelRef
52 virtual GrTexture* getTexture() SK_OVERRIDE; 50 virtual GrTexture* getTexture() SK_OVERRIDE;
53 51
54 protected: 52 protected:
55 // overrides from SkPixelRef 53 // overrides from SkPixelRef
56 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE; 54 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE;
57 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE ; 55 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE ;
58 56
59 private: 57 private:
60 GrSurface* fSurface; 58 GrSurface* fSurface;
61 bool fUnlock; // if true the pixel ref owns a texture cache lock on fSurface
62
63 typedef SkROLockPixelsPixelRef INHERITED; 59 typedef SkROLockPixelsPixelRef INHERITED;
64 }; 60 };
65 61
66 #endif 62 #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