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

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

Issue 1198603002: Rename all things "leaky" in SkDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkDevice.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { 111 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
112 SkASSERT(bm.width() == fBitmap.width()); 112 SkASSERT(bm.width() == fBitmap.width());
113 SkASSERT(bm.height() == fBitmap.height()); 113 SkASSERT(bm.height() == fBitmap.height());
114 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) 114 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config)
115 fBitmap.lockPixels(); 115 fBitmap.lockPixels();
116 } 116 }
117 117
118 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa int*) { 118 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa int*) {
119 const SkSurfaceProps leaky(0, cinfo.fPixelGeometry); 119 const SkSurfaceProps surfaceProps(0, cinfo.fPixelGeometry);
120 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); 120 return SkBitmapDevice::Create(cinfo.fInfo, &surfaceProps);
121 } 121 }
122 122
123 const SkBitmap& SkBitmapDevice::onAccessBitmap() { 123 const SkBitmap& SkBitmapDevice::onAccessBitmap() {
124 return fBitmap; 124 return fBitmap;
125 } 125 }
126 126
127 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { 127 bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) {
128 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) { 128 if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) {
129 fBitmap.notifyPixelsChanged(); 129 fBitmap.notifyPixelsChanged();
130 return true; 130 return true;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 paint.getRasterizer() || 374 paint.getRasterizer() ||
375 paint.getPathEffect() || 375 paint.getPathEffect() ||
376 paint.isFakeBoldText() || 376 paint.isFakeBoldText() ||
377 paint.getStyle() != SkPaint::kFill_Style || 377 paint.getStyle() != SkPaint::kFill_Style ||
378 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 378 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
379 { 379 {
380 return true; 380 return true;
381 } 381 }
382 return false; 382 return false;
383 } 383 }
OLDNEW
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698