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

Side by Side Diff: include/utils/SkDeferredCanvas.h

Issue 355193006: stop calling SkCanvas::getDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 SkDeferredCanvas_DEFINED 8 #ifndef SkDeferredCanvas_DEFINED
9 #define SkDeferredCanvas_DEFINED 9 #define SkDeferredCanvas_DEFINED
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 * be freed. 124 * be freed.
125 * @return number of bytes actually freed. 125 * @return number of bytes actually freed.
126 */ 126 */
127 size_t freeMemoryIfPossible(size_t bytesToFree); 127 size_t freeMemoryIfPossible(size_t bytesToFree);
128 128
129 /** 129 /**
130 * Specifies the maximum size (in bytes) allowed for a given image to be 130 * Specifies the maximum size (in bytes) allowed for a given image to be
131 * rendered using the deferred canvas. 131 * rendered using the deferred canvas.
132 */ 132 */
133 void setBitmapSizeThreshold(size_t sizeThreshold); 133 void setBitmapSizeThreshold(size_t sizeThreshold);
134 size_t getBitmapSizeThreshold() const { return fBitmapSizeThreshold; }
134 135
135 /** 136 /**
136 * Executes all pending commands without drawing 137 * Executes all pending commands without drawing
137 */ 138 */
138 void silentFlush(); 139 void silentFlush();
139 140
140 // Overrides of the SkCanvas interface 141 // Overrides of the SkCanvas interface
141 virtual bool isDrawingToLayer() const SK_OVERRIDE; 142 virtual bool isDrawingToLayer() const SK_OVERRIDE;
142 virtual void clear(SkColor) SK_OVERRIDE; 143 virtual void clear(SkColor) SK_OVERRIDE;
143 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 144 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 234
234 private: 235 private:
235 SkDeferredCanvas(SkDeferredDevice*); 236 SkDeferredCanvas(SkDeferredDevice*);
236 237
237 void recordedDrawCommand(); 238 void recordedDrawCommand();
238 SkCanvas* drawingCanvas() const; 239 SkCanvas* drawingCanvas() const;
239 SkCanvas* immediateCanvas() const; 240 SkCanvas* immediateCanvas() const;
240 bool isFullFrame(const SkRect*, const SkPaint*) const; 241 bool isFullFrame(const SkRect*, const SkPaint*) const;
241 void validate() const; 242 void validate() const;
242 void init(); 243 void init();
243 bool fDeferredDrawing; 244
245 size_t fBitmapSizeThreshold;
246 bool fDeferredDrawing;
244 247
245 friend class SkDeferredCanvasTester; // for unit testing 248 friend class SkDeferredCanvasTester; // for unit testing
246 typedef SkCanvas INHERITED; 249 typedef SkCanvas INHERITED;
247 }; 250 };
248 251
249 252
250 #endif 253 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698