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

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

Issue 98703002: Fix compilation with SK_ENABLE_INST_COUNT=1 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrPathRenderer.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 2012 Google Inc. 2 * Copyright 2012 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 #include "GrPath.h" 8 #include "GrPath.h"
9 9
10 SK_DEFINE_INST_COUNT(GrPath)
11
12 GrResourceKey GrPath::ComputeKey(const SkPath& path, const SkStrokeRec& stroke) { 10 GrResourceKey GrPath::ComputeKey(const SkPath& path, const SkStrokeRec& stroke) {
13 static const GrResourceKey::ResourceType gPathResourceType = GrResourceKey:: GenerateResourceType(); 11 static const GrResourceKey::ResourceType gPathResourceType = GrResourceKey:: GenerateResourceType();
14 static const GrCacheID::Domain gPathDomain = GrCacheID::GenerateDomain(); 12 static const GrCacheID::Domain gPathDomain = GrCacheID::GenerateDomain();
15 13
16 GrCacheID::Key key; 14 GrCacheID::Key key;
17 uint32_t* keyData = key.fData32; 15 uint32_t* keyData = key.fData32;
18 keyData[0] = path.getGenerationID(); 16 keyData[0] = path.getGenerationID();
19 17
20 SK_COMPILE_ASSERT(SkPaint::kJoinCount <= 3, cap_shift_will_be_wrong); 18 SK_COMPILE_ASSERT(SkPaint::kJoinCount <= 3, cap_shift_will_be_wrong);
21 keyData[1] = stroke.needToApply(); 19 keyData[1] = stroke.needToApply();
22 if (0 != keyData[1]) { 20 if (0 != keyData[1]) {
23 keyData[1] |= stroke.getJoin() << 1; 21 keyData[1] |= stroke.getJoin() << 1;
24 keyData[1] |= stroke.getCap() << 3; 22 keyData[1] |= stroke.getCap() << 3;
25 keyData[2] = static_cast<uint32_t>(stroke.getMiter()); 23 keyData[2] = static_cast<uint32_t>(stroke.getMiter());
26 keyData[3] = static_cast<uint32_t>(stroke.getWidth()); 24 keyData[3] = static_cast<uint32_t>(stroke.getWidth());
27 } else { 25 } else {
28 keyData[2] = 0; 26 keyData[2] = 0;
29 keyData[3] = 0; 27 keyData[3] = 0;
30 } 28 }
31 29
32 return GrResourceKey(GrCacheID(gPathDomain, key), gPathResourceType, 0); 30 return GrResourceKey(GrCacheID(gPathDomain, key), gPathResourceType, 0);
33 } 31 }
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698