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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 } else { | 97 } else { |
98 if (!bitmap.tryAllocPixels(info)) { | 98 if (!bitmap.tryAllocPixels(info)) { |
99 return NULL; | 99 return NULL; |
100 } | 100 } |
101 if (!bitmap.info().isOpaque()) { | 101 if (!bitmap.info().isOpaque()) { |
102 bitmap.eraseColor(SK_ColorTRANSPARENT); | 102 bitmap.eraseColor(SK_ColorTRANSPARENT); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 return SkNEW_ARGS(SkBitmapDevice, (bitmap, surfaceProps)); | 106 return new SkBitmapDevice(bitmap, surfaceProps); |
107 } | 107 } |
108 | 108 |
109 SkImageInfo SkBitmapDevice::imageInfo() const { | 109 SkImageInfo SkBitmapDevice::imageInfo() const { |
110 return fBitmap.info(); | 110 return fBitmap.info(); |
111 } | 111 } |
112 | 112 |
113 void SkBitmapDevice::setNewSize(const SkISize& size) { | 113 void SkBitmapDevice::setNewSize(const SkISize& size) { |
114 SkASSERT(!fBitmap.pixelRef()); | 114 SkASSERT(!fBitmap.pixelRef()); |
115 fBitmap.setInfo(fBitmap.info().makeWH(size.fWidth, size.fHeight)); | 115 fBitmap.setInfo(fBitmap.info().makeWH(size.fWidth, size.fHeight)); |
116 } | 116 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 paint.getRasterizer() || | 380 paint.getRasterizer() || |
381 paint.getPathEffect() || | 381 paint.getPathEffect() || |
382 paint.isFakeBoldText() || | 382 paint.isFakeBoldText() || |
383 paint.getStyle() != SkPaint::kFill_Style || | 383 paint.getStyle() != SkPaint::kFill_Style || |
384 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 384 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
385 { | 385 { |
386 return true; | 386 return true; |
387 } | 387 } |
388 return false; | 388 return false; |
389 } | 389 } |
OLD | NEW |