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

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

Issue 1116453002: onCreateDevice -> NULL now means the caller should create its own (bitmap) device (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 5 years, 7 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 const SkImageInfo fInfo; 342 const SkImageInfo fInfo;
343 const TileUsage fTileUsage; 343 const TileUsage fTileUsage;
344 const SkPixelGeometry fPixelGeometry; 344 const SkPixelGeometry fPixelGeometry;
345 const bool fForImageFilter; 345 const bool fForImageFilter;
346 }; 346 };
347 347
348 /** 348 /**
349 * Create a new device based on CreateInfo. If the paint is not null, then it represents a 349 * Create a new device based on CreateInfo. If the paint is not null, then it represents a
350 * preview of how the new device will be composed with its creator device ( this). 350 * preview of how the new device will be composed with its creator device ( this).
351 *
352 * The subclass may be handed this device in drawDevice(), so it must alway s return
353 * a device that it knows how to draw, and that it knows how to identify if it is not of the
354 * same subclass (since drawDevice is passed a SkBaseDevice*). If the subcl ass cannot fulfill
355 * that contract (e.g. PDF cannot support some settings on the paint) it sh ould return NULL,
356 * and the caller may then decide to explicitly create a bitmapdevice, know ing that later
357 * it could not call drawDevice with it (but it could call drawSprite or dr awBitmap).
351 */ 358 */
352 virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) { 359 virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) {
353 return NULL; 360 return NULL;
354 } 361 }
355 362
356 virtual void initForRootLayer(SkPixelGeometry geo); 363 virtual void initForRootLayer(SkPixelGeometry geo);
357 364
358 private: 365 private:
359 friend class SkCanvas; 366 friend class SkCanvas;
360 friend struct DeviceCM; //for setMatrixClip 367 friend struct DeviceCM; //for setMatrixClip
(...skipping 28 matching lines...) Expand all
389 SkDeviceProperties* fLeakyProperties; // will always exist. 396 SkDeviceProperties* fLeakyProperties; // will always exist.
390 397
391 #ifdef SK_DEBUG 398 #ifdef SK_DEBUG
392 bool fAttachedToCanvas; 399 bool fAttachedToCanvas;
393 #endif 400 #endif
394 401
395 typedef SkRefCnt INHERITED; 402 typedef SkRefCnt INHERITED;
396 }; 403 };
397 404
398 #endif 405 #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