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" |
| 11 #include "SkImageFilterCache.h" |
11 #include "SkMallocPixelRef.h" | 12 #include "SkMallocPixelRef.h" |
12 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
13 #include "SkPaint.h" | 14 #include "SkPaint.h" |
14 #include "SkPath.h" | 15 #include "SkPath.h" |
15 #include "SkPixelRef.h" | 16 #include "SkPixelRef.h" |
16 #include "SkPixmap.h" | 17 #include "SkPixmap.h" |
17 #include "SkShader.h" | 18 #include "SkShader.h" |
18 #include "SkSurface.h" | 19 #include "SkSurface.h" |
19 #include "SkXfermode.h" | 20 #include "SkXfermode.h" |
20 | 21 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 361 |
361 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, | 362 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, |
362 int x, int y, const SkPaint& paint) { | 363 int x, int y, const SkPaint& paint) { |
363 draw.drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap, x, y, paint); | 364 draw.drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap, x, y, paint); |
364 } | 365 } |
365 | 366 |
366 sk_sp<SkSurface> SkBitmapDevice::makeSurface(const SkImageInfo& info, const SkSu
rfaceProps& props) { | 367 sk_sp<SkSurface> SkBitmapDevice::makeSurface(const SkImageInfo& info, const SkSu
rfaceProps& props) { |
367 return SkSurface::MakeRaster(info, &props); | 368 return SkSurface::MakeRaster(info, &props); |
368 } | 369 } |
369 | 370 |
370 SkImageFilter::Cache* SkBitmapDevice::getImageFilterCache() { | 371 SkImageFilterCache* SkBitmapDevice::getImageFilterCache() { |
371 SkImageFilter::Cache* cache = SkImageFilter::Cache::Get(); | 372 SkImageFilterCache* cache = SkImageFilterCache::Get(); |
372 cache->ref(); | 373 cache->ref(); |
373 return cache; | 374 return cache; |
374 } | 375 } |
375 | 376 |
376 /////////////////////////////////////////////////////////////////////////////// | 377 /////////////////////////////////////////////////////////////////////////////// |
377 | 378 |
378 bool SkBitmapDevice::onShouldDisableLCD(const SkPaint& paint) const { | 379 bool SkBitmapDevice::onShouldDisableLCD(const SkPaint& paint) const { |
379 if (kN32_SkColorType != fBitmap.colorType() || | 380 if (kN32_SkColorType != fBitmap.colorType() || |
380 paint.getRasterizer() || | 381 paint.getRasterizer() || |
381 paint.getPathEffect() || | 382 paint.getPathEffect() || |
382 paint.isFakeBoldText() || | 383 paint.isFakeBoldText() || |
383 paint.getStyle() != SkPaint::kFill_Style || | 384 paint.getStyle() != SkPaint::kFill_Style || |
384 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 385 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
385 { | 386 { |
386 return true; | 387 return true; |
387 } | 388 } |
388 return false; | 389 return false; |
389 } | 390 } |
OLD | NEW |