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

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

Issue 1922123002: make context() virtual on device (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « no previous file | 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y ); 273 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y );
274 274
275 /////////////////////////////////////////////////////////////////////////// 275 ///////////////////////////////////////////////////////////////////////////
276 276
277 /** Update as needed the pixel value in the bitmap, so that the caller can 277 /** Update as needed the pixel value in the bitmap, so that the caller can
278 access the pixels directly. 278 access the pixels directly.
279 @return The device contents as a bitmap 279 @return The device contents as a bitmap
280 */ 280 */
281 virtual const SkBitmap& onAccessBitmap() = 0; 281 virtual const SkBitmap& onAccessBitmap() = 0;
282 282
283 virtual GrContext* context() const { return nullptr; }
284
283 protected: 285 protected:
284 virtual sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProp s&); 286 virtual sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProp s&);
285 virtual bool onPeekPixels(SkPixmap*) { return false; } 287 virtual bool onPeekPixels(SkPixmap*) { return false; }
286 288
287 /** 289 /**
288 * The caller is responsible for "pre-clipping" the dst. The impl can assum e that the dst 290 * The caller is responsible for "pre-clipping" the dst. The impl can assum e that the dst
289 * image at the specified x,y offset will fit within the device's bounds. 291 * image at the specified x,y offset will fit within the device's bounds.
290 * 292 *
291 * This is explicitly asserted in readPixels(), the public way to call this . 293 * This is explicitly asserted in readPixels(), the public way to call this .
292 */ 294 */
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 SkSurfaceProps fSurfaceProps; 401 SkSurfaceProps fSurfaceProps;
400 402
401 #ifdef SK_DEBUG 403 #ifdef SK_DEBUG
402 bool fAttachedToCanvas; 404 bool fAttachedToCanvas;
403 #endif 405 #endif
404 406
405 typedef SkRefCnt INHERITED; 407 typedef SkRefCnt INHERITED;
406 }; 408 };
407 409
408 #endif 410 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698