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

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

Issue 1264103003: Parallel cache - preliminary (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: parallel cache 2 Created 5 years, 3 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 | « no previous file | src/core/SkGlyph.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 mask.fBounds.set(left, top, right, bottom); 1470 mask.fBounds.set(left, top, right, bottom);
1471 1471
1472 // this extra test is worth it, assuming that most of the time it succeeds 1472 // this extra test is worth it, assuming that most of the time it succeeds
1473 // since we can avoid writing to storage 1473 // since we can avoid writing to storage
1474 if (!state.fClipBounds.containsNoEmptyCheck(left, top, right, bottom)) { 1474 if (!state.fClipBounds.containsNoEmptyCheck(left, top, right, bottom)) {
1475 if (!storage.intersectNoEmptyCheck(mask.fBounds, state.fClipBounds)) 1475 if (!storage.intersectNoEmptyCheck(mask.fBounds, state.fClipBounds))
1476 return; 1476 return;
1477 bounds = &storage; 1477 bounds = &storage;
1478 } 1478 }
1479 1479
1480 uint8_t* aa = (uint8_t*)glyph.fImage; 1480 uint8_t*aa = (uint8_t*)state.fCache->findImage(glyph);
1481 if (nullptr == aa) { 1481 if (nullptr == aa) {
1482 aa = (uint8_t*)state.fCache->findImage(glyph); 1482 return; // can't rasterize glyph
1483 if (nullptr == aa) {
1484 return; // can't rasterize glyph
1485 }
1486 } 1483 }
1487 1484
1485
1488 mask.fRowBytes = glyph.rowBytes(); 1486 mask.fRowBytes = glyph.rowBytes();
1489 mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); 1487 mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
1490 mask.fImage = aa; 1488 mask.fImage = aa;
1491 state.blitMask(mask, *bounds); 1489 state.blitMask(mask, *bounds);
1492 } 1490 }
1493 1491
1494 static void D1G_RgnClip(const SkDraw1Glyph& state, Sk48Dot16 fx, Sk48Dot16 fy, c onst SkGlyph& glyph) { 1492 static void D1G_RgnClip(const SkDraw1Glyph& state, Sk48Dot16 fx, Sk48Dot16 fy, c onst SkGlyph& glyph) {
1495 int left = Sk48Dot16FloorToInt(fx); 1493 int left = Sk48Dot16FloorToInt(fx);
1496 int top = Sk48Dot16FloorToInt(fy); 1494 int top = Sk48Dot16FloorToInt(fy);
1497 SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0); 1495 SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 mask->fImage = SkMask::AllocImage(size); 2256 mask->fImage = SkMask::AllocImage(size);
2259 memset(mask->fImage, 0, mask->computeImageSize()); 2257 memset(mask->fImage, 0, mask->computeImageSize());
2260 } 2258 }
2261 2259
2262 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2260 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2263 draw_into_mask(*mask, devPath, style); 2261 draw_into_mask(*mask, devPath, style);
2264 } 2262 }
2265 2263
2266 return true; 2264 return true;
2267 } 2265 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGlyph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698