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

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

Issue 579843002: Copy layer-hoisting related SkPaints (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Copy layer hoisting related SkPaints Created 6 years, 3 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/GrRecordReplaceDraw.h ('k') | src/gpu/SkGpuDevice.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 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"
11 11
12 GrReplacements::ReplacementInfo* GrReplacements::push() { 12 GrReplacements::ReplacementInfo* GrReplacements::push() {
13 SkDEBUGCODE(this->validate()); 13 SkDEBUGCODE(this->validate());
14 return fReplacements.push(); 14 return fReplacements.push();
15 } 15 }
16 16
17 void GrReplacements::freeAll() { 17 void GrReplacements::freeAll() {
18 for (int i = 0; i < fReplacements.count(); ++i) { 18 for (int i = 0; i < fReplacements.count(); ++i) {
19 fReplacements[i].fImage->unref(); 19 fReplacements[i].fImage->unref();
20 SkDELETE(fReplacements[i].fPaint);
20 } 21 }
21 fReplacements.reset(); 22 fReplacements.reset();
22 } 23 }
23 24
24 #ifdef SK_DEBUG 25 #ifdef SK_DEBUG
25 void GrReplacements::validate() const { 26 void GrReplacements::validate() const {
26 // Check that the ranges are monotonically increasing and non-overlapping 27 // Check that the ranges are monotonically increasing and non-overlapping
27 if (fReplacements.count() > 0) { 28 if (fReplacements.count() > 0) {
28 SkASSERT(fReplacements[0].fStart < fReplacements[0].fStop); 29 SkASSERT(fReplacements[0].fStart < fReplacements[0].fStop);
29 30
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (ri) { 117 if (ri) {
117 draw_replacement_bitmap(ri, canvas, initialMatrix); 118 draw_replacement_bitmap(ri, canvas, initialMatrix);
118 i = ri->fStop; 119 i = ri->fStop;
119 continue; 120 continue;
120 } 121 }
121 122
122 record.visit<void>(i, draw); 123 record.visit<void>(i, draw);
123 } 124 }
124 } 125 }
125 } 126 }
OLDNEW
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698