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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void SkBitmapDevice::clear(SkColor color) { | 90 void SkBitmapDevice::clear(SkColor color) { |
91 fBitmap.eraseColor(color); | 91 fBitmap.eraseColor(color); |
92 } | 92 } |
93 | 93 |
94 const SkBitmap& SkBitmapDevice::onAccessBitmap() { | 94 const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
95 return fBitmap; | 95 return fBitmap; |
96 } | 96 } |
97 | 97 |
98 bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) { | 98 bool SkBitmapDevice::canHandleImageFilter(const SkImageFilter*) { |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 bool SkBitmapDevice::filterImage(SkImageFilter* filter, const SkBitmap& src, | 102 bool SkBitmapDevice::filterImage(const SkImageFilter* filter, const SkBitmap& sr
c, |
103 const SkMatrix& ctm, SkBitmap* result, | 103 const SkMatrix& ctm, SkBitmap* result, |
104 SkIPoint* offset) { | 104 SkIPoint* offset) { |
105 return false; | 105 return false; |
106 } | 106 } |
107 | 107 |
108 bool SkBitmapDevice::allowImageFilter(SkImageFilter*) { | 108 bool SkBitmapDevice::allowImageFilter(const SkImageFilter*) { |
109 return true; | 109 return true; |
110 } | 110 } |
111 | 111 |
112 bool SkBitmapDevice::onReadPixels(const SkBitmap& bitmap, | 112 bool SkBitmapDevice::onReadPixels(const SkBitmap& bitmap, |
113 int x, int y, | 113 int x, int y, |
114 SkCanvas::Config8888 config8888) { | 114 SkCanvas::Config8888 config8888) { |
115 SkASSERT(SkBitmap::kARGB_8888_Config == bitmap.config()); | 115 SkASSERT(SkBitmap::kARGB_8888_Config == bitmap.config()); |
116 SkASSERT(!bitmap.isNull()); | 116 SkASSERT(!bitmap.isNull()); |
117 SkASSERT(SkIRect::MakeWH(this->width(), this->height()).contains(SkIRect::Ma
keXYWH(x, y, | 117 SkASSERT(SkIRect::MakeWH(this->width(), this->height()).contains(SkIRect::Ma
keXYWH(x, y, |
118 bitmap
.width(), | 118 bitmap
.width(), |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 paint.getStyle() != SkPaint::kFill_Style || | 401 paint.getStyle() != SkPaint::kFill_Style || |
402 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 402 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
403 // turn off lcd | 403 // turn off lcd |
404 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 404 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
405 flags->fHinting = paint.getHinting(); | 405 flags->fHinting = paint.getHinting(); |
406 return true; | 406 return true; |
407 } | 407 } |
408 // we're cool with the paint as is | 408 // we're cool with the paint as is |
409 return false; | 409 return false; |
410 } | 410 } |
OLD | NEW |