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

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

Issue 1132093004: Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (Closed) Base URL: https://skia.googlesource.com/skia.git@copy
Patch Set: remove asserts Created 5 years, 7 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 | « no previous file | include/gpu/GrXferProcessor.h » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef GrTexture_DEFINED 9 #ifndef GrTexture_DEFINED
10 #define GrTexture_DEFINED 10 #define GrTexture_DEFINED
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // These two shift a fixed-point value into normalized coordinates 63 // These two shift a fixed-point value into normalized coordinates
64 // for this texture if the texture is power of two sized. 64 // for this texture if the texture is power of two sized.
65 int fShiftFixedX; 65 int fShiftFixedX;
66 int fShiftFixedY; 66 int fShiftFixedY;
67 67
68 friend class GrTexturePriv; 68 friend class GrTexturePriv;
69 69
70 typedef GrSurface INHERITED; 70 typedef GrSurface INHERITED;
71 }; 71 };
72 72
73 /**
74 * Represents a texture that is intended to be accessed in device coords with an offset.
75 */
76 class GrDeviceCoordTexture {
77 public:
78 GrDeviceCoordTexture() { fOffset.set(0, 0); }
79
80 GrDeviceCoordTexture(const GrDeviceCoordTexture& other) {
81 *this = other;
82 }
83
84 GrDeviceCoordTexture(GrTexture* texture, const SkIPoint& offset)
85 : fTexture(SkSafeRef(texture))
86 , fOffset(offset) {
87 }
88
89 GrDeviceCoordTexture& operator=(const GrDeviceCoordTexture& other) {
90 fTexture.reset(SkSafeRef(other.fTexture.get()));
91 fOffset = other.fOffset;
92 return *this;
93 }
94
95 const SkIPoint& offset() const { return fOffset; }
96
97 void setOffset(const SkIPoint& offset) { fOffset = offset; }
98 void setOffset(int ox, int oy) { fOffset.set(ox, oy); }
99
100 GrTexture* texture() const { return fTexture.get(); }
101
102 GrTexture* setTexture(GrTexture* texture) {
103 fTexture.reset(SkSafeRef(texture));
104 return texture;
105 }
106
107 private:
108 SkAutoTUnref<GrTexture> fTexture;
109 SkIPoint fOffset;
110 };
111
112 #endif 73 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698