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

Side by Side Diff: src/gpu/GrDrawTarget.cpp

Issue 596053002: Make "priv" classes for GrTexure and GrSurface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SK_API 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 | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrSurface.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 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 9
10 10
11 #include "GrDrawTarget.h" 11 #include "GrDrawTarget.h"
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrDrawTargetCaps.h" 13 #include "GrDrawTargetCaps.h"
14 #include "GrPath.h" 14 #include "GrPath.h"
15 #include "GrRenderTarget.h" 15 #include "GrRenderTarget.h"
16 #include "GrSurfacePriv.h"
16 #include "GrTemplates.h" 17 #include "GrTemplates.h"
17 #include "GrTexture.h" 18 #include "GrTexture.h"
18 #include "GrVertexBuffer.h" 19 #include "GrVertexBuffer.h"
19 20
20 #include "SkStrokeRec.h" 21 #include "SkStrokeRec.h"
21 22
22 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
23 24
24 GrDrawTarget::DrawInfo& GrDrawTarget::DrawInfo::operator =(const DrawInfo& di) { 25 GrDrawTarget::DrawInfo& GrDrawTarget::DrawInfo::operator =(const DrawInfo& di) {
25 fPrimitiveType = di.fPrimitiveType; 26 fPrimitiveType = di.fPrimitiveType;
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 GrSurface* src, 958 GrSurface* src,
958 const SkIRect& srcRect, 959 const SkIRect& srcRect,
959 const SkIPoint& dstPoint) { 960 const SkIPoint& dstPoint) {
960 // Check that the read/write rects are contained within the src/dst bounds. 961 // Check that the read/write rects are contained within the src/dst bounds.
961 SkASSERT(!srcRect.isEmpty()); 962 SkASSERT(!srcRect.isEmpty());
962 SkASSERT(SkIRect::MakeWH(src->width(), src->height()).contains(srcRect)); 963 SkASSERT(SkIRect::MakeWH(src->width(), src->height()).contains(srcRect));
963 SkASSERT(dstPoint.fX >= 0 && dstPoint.fY >= 0); 964 SkASSERT(dstPoint.fX >= 0 && dstPoint.fY >= 0);
964 SkASSERT(dstPoint.fX + srcRect.width() <= dst->width() && 965 SkASSERT(dstPoint.fX + srcRect.width() <= dst->width() &&
965 dstPoint.fY + srcRect.height() <= dst->height()); 966 dstPoint.fY + srcRect.height() <= dst->height());
966 967
967 return !dst->isSameAs(src) && dst->asRenderTarget() && src->asTexture(); 968 return !dst->surfacePriv().isSameAs(src) && dst->asRenderTarget() && src->as Texture();
968 } 969 }
969 970
970 bool GrDrawTarget::onCopySurface(GrSurface* dst, 971 bool GrDrawTarget::onCopySurface(GrSurface* dst,
971 GrSurface* src, 972 GrSurface* src,
972 const SkIRect& srcRect, 973 const SkIRect& srcRect,
973 const SkIPoint& dstPoint) { 974 const SkIPoint& dstPoint) {
974 if (!GrDrawTarget::onCanCopySurface(dst, src, srcRect, dstPoint)) { 975 if (!GrDrawTarget::onCanCopySurface(dst, src, srcRect, dstPoint)) {
975 return false; 976 return false;
976 } 977 }
977 978
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1151
1151 uint32_t GrDrawTargetCaps::CreateUniqueID() { 1152 uint32_t GrDrawTargetCaps::CreateUniqueID() {
1152 static int32_t gUniqueID = SK_InvalidUniqueID; 1153 static int32_t gUniqueID = SK_InvalidUniqueID;
1153 uint32_t id; 1154 uint32_t id;
1154 do { 1155 do {
1155 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 1156 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
1156 } while (id == SK_InvalidUniqueID); 1157 } while (id == SK_InvalidUniqueID);
1157 return id; 1158 return id;
1158 } 1159 }
1159 1160
OLDNEW
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698