OLD | NEW |
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 #include "SkLayer.h" | 8 #include "SkLayer.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 | 10 |
11 //#define DEBUG_DRAW_LAYER_BOUNDS | 11 //#define DEBUG_DRAW_LAYER_BOUNDS |
12 //#define DEBUG_TRACK_NEW_DELETE | 12 //#define DEBUG_TRACK_NEW_DELETE |
13 | 13 |
14 #ifdef DEBUG_TRACK_NEW_DELETE | 14 #ifdef DEBUG_TRACK_NEW_DELETE |
15 static int gLayerAllocCount; | 15 static int gLayerAllocCount; |
16 #endif | 16 #endif |
17 | 17 |
18 SK_DEFINE_INST_COUNT(SkLayer) | |
19 | |
20 /////////////////////////////////////////////////////////////////////////////// | 18 /////////////////////////////////////////////////////////////////////////////// |
21 | 19 |
22 SkLayer::SkLayer() { | 20 SkLayer::SkLayer() { |
23 fParent = NULL; | 21 fParent = NULL; |
24 m_opacity = SK_Scalar1; | 22 m_opacity = SK_Scalar1; |
25 m_size.set(0, 0); | 23 m_size.set(0, 0); |
26 m_position.set(0, 0); | 24 m_position.set(0, 0); |
27 m_anchorPoint.set(SK_ScalarHalf, SK_ScalarHalf); | 25 m_anchorPoint.set(SK_ScalarHalf, SK_ScalarHalf); |
28 | 26 |
29 fMatrix.reset(); | 27 fMatrix.reset(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 #endif | 221 #endif |
224 | 222 |
225 int count = this->countChildren(); | 223 int count = this->countChildren(); |
226 if (count > 0) { | 224 if (count > 0) { |
227 canvas->concat(this->getChildrenMatrix()); | 225 canvas->concat(this->getChildrenMatrix()); |
228 for (int i = 0; i < count; i++) { | 226 for (int i = 0; i < count; i++) { |
229 this->getChild(i)->draw(canvas, opacity); | 227 this->getChild(i)->draw(canvas, opacity); |
230 } | 228 } |
231 } | 229 } |
232 } | 230 } |
OLD | NEW |