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

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

Issue 912243004: Make all SkSurface_* -related devices all have a device (Closed) Base URL: https://skia.googlesource.com/skia.git@skimage-filters-03-sksurface-set-root-device
Patch Set: Created 5 years, 10 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 | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.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 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 SkDevice_DEFINED 8 #ifndef SkDevice_DEFINED
9 #define SkDevice_DEFINED 9 #define SkDevice_DEFINED
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 * possibly from SkCanvas' dtor. 116 * possibly from SkCanvas' dtor.
117 */ 117 */
118 virtual void onDetachFromCanvas() { 118 virtual void onDetachFromCanvas() {
119 SkASSERT(fAttachedToCanvas); 119 SkASSERT(fAttachedToCanvas);
120 this->unlockPixels(); 120 this->unlockPixels();
121 #ifdef SK_DEBUG 121 #ifdef SK_DEBUG
122 fAttachedToCanvas = false; 122 fAttachedToCanvas = false;
123 #endif 123 #endif
124 }; 124 };
125 125
126 /** This makes the contents of this device undefined.
127 * See SkCanvas::discard()
128 */
129 virtual void discard() { }
130
126 protected: 131 protected:
127 enum Usage { 132 enum Usage {
128 kGeneral_Usage, 133 kGeneral_Usage,
129 kSaveLayer_Usage, // <! internal use only 134 kSaveLayer_Usage, // <! internal use only
130 kImageFilter_Usage // <! internal use only 135 kImageFilter_Usage // <! internal use only
131 }; 136 };
132 137
133 struct TextFlags { 138 struct TextFlags {
134 uint32_t fFlags; // SkPaint::getFlags() 139 uint32_t fFlags; // SkPaint::getFlags()
135 }; 140 };
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 friend class SkCanvas; 365 friend class SkCanvas;
361 friend struct DeviceCM; //for setMatrixClip 366 friend struct DeviceCM; //for setMatrixClip
362 friend class SkDraw; 367 friend class SkDraw;
363 friend class SkDrawIter; 368 friend class SkDrawIter;
364 friend class SkDeviceFilteredPaint; 369 friend class SkDeviceFilteredPaint;
365 friend class SkDeviceImageFilterProxy; 370 friend class SkDeviceImageFilterProxy;
366 friend class SkDeferredDevice; // for newSurface 371 friend class SkDeferredDevice; // for newSurface
367 friend class SkNoPixelsBitmapDevice; 372 friend class SkNoPixelsBitmapDevice;
368 373
369 friend class SkSurface_Raster; 374 friend class SkSurface_Raster;
375 friend class SkSurface_Gpu;
376 friend class SkGpuDevice;
370 377
371 // used to change the backend's pixels (and possibly config/rowbytes) 378 // used to change the backend's pixels (and possibly config/rowbytes)
372 // but cannot change the width/height, so there should be no change to 379 // but cannot change the width/height, so there should be no change to
373 // any clip information. 380 // any clip information.
374 // TODO: move to SkBitmapDevice 381 // TODO: move to SkBitmapDevice
375 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} 382 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {}
376 383
377 virtual bool forceConservativeRasterClip() const { return false; } 384 virtual bool forceConservativeRasterClip() const { return false; }
378 385
379 // just called by SkCanvas when built as a layer 386 // just called by SkCanvas when built as a layer
(...skipping 10 matching lines...) Expand all
390 SkDeviceProperties* fLeakyProperties; // will always exist. 397 SkDeviceProperties* fLeakyProperties; // will always exist.
391 398
392 #ifdef SK_DEBUG 399 #ifdef SK_DEBUG
393 bool fAttachedToCanvas; 400 bool fAttachedToCanvas;
394 #endif 401 #endif
395 402
396 typedef SkRefCnt INHERITED; 403 typedef SkRefCnt INHERITED;
397 }; 404 };
398 405
399 #endif 406 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698