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

Side by Side Diff: src/gpu/GrLayerHoister.cpp

Issue 607763008: Update GrRecordReplaceDraw to use SkTDynamicHash & add ReplaceDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Re-add missing header Created 6 years, 2 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/core/SkPicture.h ('k') | src/gpu/GrRecordReplaceDraw.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 2014 Google Inc. 2 * Copyright 2014 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 "GrLayerCache.h" 8 #include "GrLayerCache.h"
9 #include "GrLayerHoister.h" 9 #include "GrLayerHoister.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); 128 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
129 result->setInfo(info); 129 result->setInfo(info);
130 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); 130 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
131 } 131 }
132 132
133 static void convert_layers_to_replacements(const SkTDArray<GrLayerHoister::Hoist edLayer>& layers, 133 static void convert_layers_to_replacements(const SkTDArray<GrLayerHoister::Hoist edLayer>& layers,
134 GrReplacements* replacements) { 134 GrReplacements* replacements) {
135 // TODO: just replace GrReplacements::ReplacementInfo with GrCachedLayer? 135 // TODO: just replace GrReplacements::ReplacementInfo with GrCachedLayer?
136 for (int i = 0; i < layers.count(); ++i) { 136 for (int i = 0; i < layers.count(); ++i) {
137 GrCachedLayer* layer = layers[i].fLayer; 137 GrCachedLayer* layer = layers[i].fLayer;
138 const SkPicture* picture = layers[i].fPicture;
138 139
139 GrReplacements::ReplacementInfo* layerInfo = replacements->push(); 140 GrReplacements::ReplacementInfo* layerInfo =
140 layerInfo->fStart = layer->start(); 141 replacements->newReplacement(picture->uniqueID(),
142 layer->start(),
143 layers[i].fCTM);
141 layerInfo->fStop = layer->stop(); 144 layerInfo->fStop = layer->stop();
142 layerInfo->fPos = layers[i].fOffset; 145 layerInfo->fPos = layers[i].fOffset;
143 146
144 SkBitmap bm; 147 SkBitmap bm;
145 wrap_texture(layers[i].fLayer->texture(), 148 wrap_texture(layers[i].fLayer->texture(),
146 !layers[i].fLayer->isAtlased() ? layers[i].fLayer->rect().w idth() 149 !layers[i].fLayer->isAtlased() ? layers[i].fLayer->rect().w idth()
147 : layers[i].fLayer->texture( )->width(), 150 : layers[i].fLayer->texture( )->width(),
148 !layers[i].fLayer->isAtlased() ? layers[i].fLayer->rect().h eight() 151 !layers[i].fLayer->isAtlased() ? layers[i].fLayer->rect().h eight()
149 : layers[i].fLayer->texture( )->height(), 152 : layers[i].fLayer->texture( )->height(),
150 &bm); 153 &bm);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 294 }
292 295
293 #if DISABLE_CACHING 296 #if DISABLE_CACHING
294 // This code completely clears out the atlas. It is required when 297 // This code completely clears out the atlas. It is required when
295 // caching is disabled so the atlas doesn't fill up and force more 298 // caching is disabled so the atlas doesn't fill up and force more
296 // free floating layers 299 // free floating layers
297 layerCache->purgeAll(); 300 layerCache->purgeAll();
298 #endif 301 #endif
299 } 302 }
300 303
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/gpu/GrRecordReplaceDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698