OLD | NEW |
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return fBitmap.info(); | 104 return fBitmap.info(); |
105 } | 105 } |
106 | 106 |
107 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { | 107 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { |
108 SkASSERT(bm.width() == fBitmap.width()); | 108 SkASSERT(bm.width() == fBitmap.width()); |
109 SkASSERT(bm.height() == fBitmap.height()); | 109 SkASSERT(bm.height() == fBitmap.height()); |
110 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) | 110 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) |
111 fBitmap.lockPixels(); | 111 fBitmap.lockPixels(); |
112 } | 112 } |
113 | 113 |
114 SkBaseDevice* SkBitmapDevice::onCreateDevice(const SkImageInfo& info, Usage usag
e) { | 114 SkBaseDevice* SkBitmapDevice::onCreateCompatibleDevice(const CreateInfo& cinfo)
{ |
115 return SkBitmapDevice::Create(info);// &this->getDeviceProperties()); | 115 return SkBitmapDevice::Create(cinfo.fInfo);// &this->getDeviceProperties()); |
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 |
124 void SkBitmapDevice::unlockPixels() { | 124 void SkBitmapDevice::unlockPixels() { |
125 if (fBitmap.lockPixelsAreWritable()) { | 125 if (fBitmap.lockPixelsAreWritable()) { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 paint.getStyle() != SkPaint::kFill_Style || | 396 paint.getStyle() != SkPaint::kFill_Style || |
397 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 397 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
398 // turn off lcd, but turn on kGenA8 | 398 // turn off lcd, but turn on kGenA8 |
399 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 399 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
400 flags->fFlags |= SkPaint::kGenA8FromLCD_Flag; | 400 flags->fFlags |= SkPaint::kGenA8FromLCD_Flag; |
401 return true; | 401 return true; |
402 } | 402 } |
403 // we're cool with the paint as is | 403 // we're cool with the paint as is |
404 return false; | 404 return false; |
405 } | 405 } |
OLD | NEW |