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

Side by Side Diff: src/core/SkDevice.cpp

Issue 161733002: add peekPixels to SkCanvas and SkSurface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 #include "SkDevice.h" 8 #include "SkDevice.h"
9 #include "SkMetaData.h" 9 #include "SkMetaData.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 SkMetaData& SkBaseDevice::getMetaData() { 59 SkMetaData& SkBaseDevice::getMetaData() {
60 // metadata users are rare, so we lazily allocate it. If that changes we 60 // metadata users are rare, so we lazily allocate it. If that changes we
61 // can decide to just make it a field in the device (rather than a ptr) 61 // can decide to just make it a field in the device (rather than a ptr)
62 if (NULL == fMetaData) { 62 if (NULL == fMetaData) {
63 fMetaData = new SkMetaData; 63 fMetaData = new SkMetaData;
64 } 64 }
65 return *fMetaData; 65 return *fMetaData;
66 } 66 }
67 67
68 // TODO: should make this guy pure-virtual.
69 SkImageInfo SkBaseDevice::imageInfo() const {
70 return SkImageInfo::Make(this->width(), this->height(),
71 kUnknown_SkColorType, kIgnore_SkAlphaType);
72 }
73
68 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { 74 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) {
69 const SkBitmap& bitmap = this->onAccessBitmap(); 75 const SkBitmap& bitmap = this->onAccessBitmap();
70 if (changePixels) { 76 if (changePixels) {
71 bitmap.notifyPixelsChanged(); 77 bitmap.notifyPixelsChanged();
72 } 78 }
73 return bitmap; 79 return bitmap;
74 } 80 }
75 81
76 bool SkBaseDevice::readPixels(SkBitmap* bitmap, int x, int y, 82 bool SkBaseDevice::readPixels(SkBitmap* bitmap, int x, int y,
77 SkCanvas::Config8888 config8888) { 83 SkCanvas::Config8888 config8888) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 srcRect.fLeft, 116 srcRect.fLeft,
111 srcRect.fTop, 117 srcRect.fTop,
112 config8888); 118 config8888);
113 if (result && bmp == &tmp) { 119 if (result && bmp == &tmp) {
114 tmp.swap(*bitmap); 120 tmp.swap(*bitmap);
115 } 121 }
116 return result; 122 return result;
117 } 123 }
118 124
119 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; } 125 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; }
126
127 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698