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

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

Issue 988413003: Change device creation to see the (optional) layer-paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments Created 5 years, 9 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
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 "SkDeviceProperties.h" 10 #include "SkDeviceProperties.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return fBitmap.info(); 103 return fBitmap.info();
104 } 104 }
105 105
106 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { 106 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
107 SkASSERT(bm.width() == fBitmap.width()); 107 SkASSERT(bm.width() == fBitmap.width());
108 SkASSERT(bm.height() == fBitmap.height()); 108 SkASSERT(bm.height() == fBitmap.height());
109 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) 109 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config)
110 fBitmap.lockPixels(); 110 fBitmap.lockPixels();
111 } 111 }
112 112
113 SkBaseDevice* SkBitmapDevice::onCreateCompatibleDevice(const CreateInfo& cinfo) { 113 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa int*) {
114 SkDeviceProperties leaky(cinfo.fPixelGeometry); 114 SkDeviceProperties leaky(cinfo.fPixelGeometry);
115 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); 115 return SkBitmapDevice::Create(cinfo.fInfo, &leaky);
116 } 116 }
117 117
118 void SkBitmapDevice::lockPixels() { 118 void SkBitmapDevice::lockPixels() {
119 if (fBitmap.lockPixelsAreWritable()) { 119 if (fBitmap.lockPixelsAreWritable()) {
120 fBitmap.lockPixels(); 120 fBitmap.lockPixels();
121 } 121 }
122 } 122 }
123 123
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 paint.getRasterizer() || 376 paint.getRasterizer() ||
377 paint.getPathEffect() || 377 paint.getPathEffect() ||
378 paint.isFakeBoldText() || 378 paint.isFakeBoldText() ||
379 paint.getStyle() != SkPaint::kFill_Style || 379 paint.getStyle() != SkPaint::kFill_Style ||
380 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 380 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
381 { 381 {
382 return true; 382 return true;
383 } 383 }
384 return false; 384 return false;
385 } 385 }
OLDNEW
« no previous file with comments | « include/device/xps/SkXPSDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698