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

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

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/GrLayerCache.h ('k') | src/gpu/GrRecordReplaceDraw.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 #ifndef GrRecordReplaceDraw_DEFINED 8 #ifndef GrRecordReplaceDraw_DEFINED
9 #define GrRecordReplaceDraw_DEFINED 9 #define GrRecordReplaceDraw_DEFINED
10 10
(...skipping 12 matching lines...) Expand all
23 // a single drawBitmap call (using a precomputed bitmap). 23 // a single drawBitmap call (using a precomputed bitmap).
24 class GrReplacements { 24 class GrReplacements {
25 public: 25 public:
26 // All the operations between fStart and fStop (inclusive) will be replaced with 26 // All the operations between fStart and fStop (inclusive) will be replaced with
27 // a single drawBitmap call using fPos, fBM and fPaint. 27 // a single drawBitmap call using fPos, fBM and fPaint.
28 struct ReplacementInfo { 28 struct ReplacementInfo {
29 unsigned fStart; 29 unsigned fStart;
30 unsigned fStop; 30 unsigned fStop;
31 SkIPoint fPos; 31 SkIPoint fPos;
32 SkImage* fImage; // Owns a ref 32 SkImage* fImage; // Owns a ref
33 const SkPaint* fPaint; // Note: this object doesn't own the paint 33 const SkPaint* fPaint; // Owned by this object
34 34
35 SkIRect fSrcRect; 35 SkIRect fSrcRect;
36 }; 36 };
37 37
38 ~GrReplacements() { this->freeAll(); } 38 ~GrReplacements() { this->freeAll(); }
39 39
40 // Add a new replacement range. The replacement ranges should be 40 // Add a new replacement range. The replacement ranges should be
41 // sorted in increasing order and non-overlapping (esp. no nested 41 // sorted in increasing order and non-overlapping (esp. no nested
42 // saveLayers). 42 // saveLayers).
43 ReplacementInfo* push(); 43 ReplacementInfo* push();
(...skipping 16 matching lines...) Expand all
60 60
61 // Draw an SkRecord into an SkCanvas replacing saveLayer/restore blocks with 61 // Draw an SkRecord into an SkCanvas replacing saveLayer/restore blocks with
62 // drawBitmap calls. A convenience wrapper around SkRecords::Draw. 62 // drawBitmap calls. A convenience wrapper around SkRecords::Draw.
63 void GrRecordReplaceDraw(const SkRecord&, 63 void GrRecordReplaceDraw(const SkRecord&,
64 SkCanvas*, 64 SkCanvas*,
65 const SkBBoxHierarchy*, 65 const SkBBoxHierarchy*,
66 const GrReplacements*, 66 const GrReplacements*,
67 SkDrawPictureCallback*); 67 SkDrawPictureCallback*);
68 68
69 #endif // GrRecordReplaceDraw_DEFINED 69 #endif // GrRecordReplaceDraw_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698