OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrRecordReplaceDraw.h" | 8 #include "GrRecordReplaceDraw.h" |
9 #include "SkImage.h" | 9 #include "SkImage.h" |
10 #include "SkRecordDraw.h" | 10 #include "SkRecordDraw.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 SkRect query = { 0, 0, 0, 0 }; | 80 SkRect query = { 0, 0, 0, 0 }; |
81 (void)canvas->getClipBounds(&query); | 81 (void)canvas->getClipBounds(&query); |
82 | 82 |
83 SkTDArray<void*> ops; | 83 SkTDArray<void*> ops; |
84 bbh->search(query, &ops); | 84 bbh->search(query, &ops); |
85 | 85 |
86 for (int i = 0; i < ops.count(); i++) { | 86 for (int i = 0; i < ops.count(); i++) { |
87 if (NULL != callback && callback->abortDrawing()) { | 87 if (NULL != callback && callback->abortDrawing()) { |
88 return; | 88 return; |
89 } | 89 } |
90 ri = replacements->lookupByStart(i, &searchStart); | 90 ri = replacements->lookupByStart((uintptr_t)ops[i], &searchStart); |
91 if (NULL != ri) { | 91 if (NULL != ri) { |
92 draw_replacement_bitmap(ri, canvas); | 92 draw_replacement_bitmap(ri, canvas); |
93 | 93 |
94 while ((uintptr_t)ops[i] < ri->fStop) { | 94 while ((uintptr_t)ops[i] < ri->fStop) { |
95 ++i; | 95 ++i; |
96 } | 96 } |
97 SkASSERT((uintptr_t)ops[i] == ri->fStop); | 97 SkASSERT((uintptr_t)ops[i] == ri->fStop); |
98 continue; | 98 continue; |
99 } | 99 } |
100 | 100 |
101 record.visit<void>((uintptr_t)ops[i], draw); | 101 record.visit<void>((uintptr_t)ops[i], draw); |
102 } | 102 } |
103 } else { | 103 } else { |
104 for (unsigned int i = 0; i < record.count(); ++i) { | 104 for (unsigned int i = 0; i < record.count(); ++i) { |
105 if (NULL != callback && callback->abortDrawing()) { | 105 if (NULL != callback && callback->abortDrawing()) { |
106 return; | 106 return; |
107 } | 107 } |
108 ri = replacements->lookupByStart(i, &searchStart); | 108 ri = replacements->lookupByStart(i, &searchStart); |
109 if (NULL != ri) { | 109 if (NULL != ri) { |
110 draw_replacement_bitmap(ri, canvas); | 110 draw_replacement_bitmap(ri, canvas); |
111 | 111 |
112 i = ri->fStop; | 112 i = ri->fStop; |
113 continue; | 113 continue; |
114 } | 114 } |
115 | 115 |
116 record.visit<void>(i, draw); | 116 record.visit<void>(i, draw); |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
OLD | NEW |