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

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

Issue 1420963008: Pull texture-backed bitmap resampler out of GrTextureParamsAdjuster code into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@nomin
Patch Set: fix unused var warning Created 5 years, 1 month 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 | « src/core/SkImageCacherator.h ('k') | src/gpu/GrGpu.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 2015 Google Inc. 2 * Copyright 2015 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapCache.h" 9 #include "SkBitmapCache.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return set_key_and_return(tex, key); 266 return set_key_and_return(tex, key);
267 } 267 }
268 } 268 }
269 return nullptr; 269 return nullptr;
270 } 270 }
271 271
272 //////////////////////////////////////////////////////////////////////////////// /////////////////// 272 //////////////////////////////////////////////////////////////////////////////// ///////////////////
273 273
274 #include "GrTextureParamsAdjuster.h" 274 #include "GrTextureParamsAdjuster.h"
275 275
276 class Cacherator_GrTextureParamsAdjuster : public GrTextureParamsAdjuster { 276 class Cacherator_GrTextureMaker : public GrTextureMaker {
277 public: 277 public:
278 Cacherator_GrTextureParamsAdjuster(SkImageCacherator* cacher, const SkImage* client) 278 Cacherator_GrTextureMaker(SkImageCacherator* cacher, const SkImage* client)
279 : INHERITED(cacher->info().width(), cacher->info().height()) 279 : INHERITED(cacher->info().width(), cacher->info().height())
280 , fCacher(cacher) 280 , fCacher(cacher)
281 , fClient(client) 281 , fClient(client)
282 { 282 {
283 if (client) { 283 if (client) {
284 GrMakeKeyFromImageID(&fOriginalKey, client->uniqueID(), 284 GrMakeKeyFromImageID(&fOriginalKey, client->uniqueID(),
285 SkIRect::MakeWH(this->width(), this->height())) ; 285 SkIRect::MakeWH(this->width(), this->height())) ;
286 } 286 }
287 } 287 }
288 288
(...skipping 16 matching lines...) Expand all
305 if (fClient) { 305 if (fClient) {
306 as_IB(fClient)->notifyAddedToCache(); 306 as_IB(fClient)->notifyAddedToCache();
307 } 307 }
308 } 308 }
309 309
310 private: 310 private:
311 SkImageCacherator* fCacher; 311 SkImageCacherator* fCacher;
312 const SkImage* fClient; 312 const SkImage* fClient;
313 GrUniqueKey fOriginalKey; 313 GrUniqueKey fOriginalKey;
314 314
315 typedef GrTextureParamsAdjuster INHERITED; 315 typedef GrTextureMaker INHERITED;
316 }; 316 };
317 317
318 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s& params, 318 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s& params,
319 const SkImage* client) { 319 const SkImage* client) {
320 if (!ctx) { 320 if (!ctx) {
321 return nullptr; 321 return nullptr;
322 } 322 }
323 323
324 return Cacherator_GrTextureParamsAdjuster(this, client).refTextureForParams( ctx, params); 324 return Cacherator_GrTextureMaker(this, client).refTextureForParams(ctx, para ms);
325 } 325 }
326 326
327 #else 327 #else
328 328
329 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&, 329 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&,
330 const SkImage* client) { 330 const SkImage* client) {
331 return nullptr; 331 return nullptr;
332 } 332 }
333 333
334 #endif 334 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageCacherator.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698