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

Side by Side Diff: include/core/SkPictureRecorder.h

Issue 492023002: Install a hook to swap between SkPicture backends with a single define. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 4 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 | « gyp/common_conditions.gypi ('k') | src/core/SkPicture.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 SkPictureRecorder_DEFINED 8 #ifndef SkPictureRecorder_DEFINED
9 #define SkPictureRecorder_DEFINED 9 #define SkPictureRecorder_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 @param height the base width for the picture, as if the recording 34 @param height the base width for the picture, as if the recording
35 canvas' bitmap had this height. 35 canvas' bitmap had this height.
36 @param bbhFactory factory to create desired acceleration structure 36 @param bbhFactory factory to create desired acceleration structure
37 @param recordFlags optional flags that control recording. 37 @param recordFlags optional flags that control recording.
38 @return the canvas. 38 @return the canvas.
39 */ 39 */
40 SkCanvas* beginRecording(int width, int height, 40 SkCanvas* beginRecording(int width, int height,
41 SkBBHFactory* bbhFactory = NULL, 41 SkBBHFactory* bbhFactory = NULL,
42 uint32_t recordFlags = 0); 42 uint32_t recordFlags = 0);
43 43
44 /** Same as beginRecording(), using a new faster backend. */ 44 // As usual, we have a deprecated old version and a maybe almost working
45 // new version. We currently point beginRecording() to
46 // DEPRECATED_beginRecording() unless SK_PICTURE_USE_SK_RECORD is defined,
47 // then we use EXPERIMENTAL_beginRecording().
48
49 // Old slower backend.
50 SkCanvas* DEPRECATED_beginRecording(int width, int height,
51 SkBBHFactory* bbhFactory = NULL,
52 uint32_t recordFlags = 0);
53
54 // New faster backend.
45 SkCanvas* EXPERIMENTAL_beginRecording(int width, int height, 55 SkCanvas* EXPERIMENTAL_beginRecording(int width, int height,
46 SkBBHFactory* bbhFactory = NULL); 56 SkBBHFactory* bbhFactory = NULL);
47 57
48 /** Returns the recording canvas if one is active, or NULL if recording is 58 /** Returns the recording canvas if one is active, or NULL if recording is
49 not active. This does not alter the refcnt on the canvas (if present). 59 not active. This does not alter the refcnt on the canvas (if present).
50 */ 60 */
51 SkCanvas* getRecordingCanvas(); 61 SkCanvas* getRecordingCanvas();
52 62
53 /** Signal that the caller is done recording. This invalidates the canvas 63 /** Signal that the caller is done recording. This invalidates the canvas
54 returned by beginRecording/getRecordingCanvas, and returns the 64 returned by beginRecording/getRecordingCanvas, and returns the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 SkAutoTUnref<SkPictureRecord> fPictureRecord; // beginRecording() 96 SkAutoTUnref<SkPictureRecord> fPictureRecord; // beginRecording()
87 SkAutoTUnref<SkRecorder> fRecorder; // EXPERIMENTAL_beginRecordin g() 97 SkAutoTUnref<SkRecorder> fRecorder; // EXPERIMENTAL_beginRecordin g()
88 98
89 // Used by EXPERIMENTAL_beginRecording(). 99 // Used by EXPERIMENTAL_beginRecording().
90 SkAutoTDelete<SkRecord> fRecord; 100 SkAutoTDelete<SkRecord> fRecord;
91 101
92 typedef SkNoncopyable INHERITED; 102 typedef SkNoncopyable INHERITED;
93 }; 103 };
94 104
95 #endif 105 #endif
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698