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

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

Issue 414483003: Implement a persistent uniqueID-based cache for SkImageFilter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix cross-process issue (revert those changes to HEAD^^) Created 6 years, 4 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
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 *info = bmInfo; 360 *info = bmInfo;
361 } 361 }
362 if (rowBytes) { 362 if (rowBytes) {
363 *rowBytes = fBitmap.rowBytes(); 363 *rowBytes = fBitmap.rowBytes();
364 } 364 }
365 return fBitmap.getPixels(); 365 return fBitmap.getPixels();
366 } 366 }
367 return NULL; 367 return NULL;
368 } 368 }
369 369
370 SkImageFilter::UniqueIDCache* SkBitmapDevice::getImageFilterCache() {
371 SkImageFilter::UniqueIDCache* cache = SkImageFilter::UniqueIDCache::Get();
372 cache->ref();
373 return cache;
374 }
375
370 /////////////////////////////////////////////////////////////////////////////// 376 ///////////////////////////////////////////////////////////////////////////////
371 377
372 bool SkBitmapDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) { 378 bool SkBitmapDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) {
373 if (!paint.isLCDRenderText() || !paint.isAntiAlias()) { 379 if (!paint.isLCDRenderText() || !paint.isAntiAlias()) {
374 // we're cool with the paint as is 380 // we're cool with the paint as is
375 return false; 381 return false;
376 } 382 }
377 383
378 if (kN32_SkColorType != fBitmap.colorType() || 384 if (kN32_SkColorType != fBitmap.colorType() ||
379 paint.getRasterizer() || 385 paint.getRasterizer() ||
380 paint.getPathEffect() || 386 paint.getPathEffect() ||
381 paint.isFakeBoldText() || 387 paint.isFakeBoldText() ||
382 paint.getStyle() != SkPaint::kFill_Style || 388 paint.getStyle() != SkPaint::kFill_Style ||
383 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { 389 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
384 // turn off lcd 390 // turn off lcd
385 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; 391 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
386 flags->fHinting = paint.getHinting(); 392 flags->fHinting = paint.getHinting();
387 return true; 393 return true;
388 } 394 }
389 // we're cool with the paint as is 395 // we're cool with the paint as is
390 return false; 396 return false;
391 } 397 }
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698