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

Side by Side Diff: src/gpu/GrImageIDTextureAdjuster.h

Issue 2242373002: simplify GrTextureAdjuster given there is only one subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « no previous file | src/gpu/GrImageIDTextureAdjuster.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 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 #ifndef GrImageIDTextureAdjuster_DEFINED 8 #ifndef GrImageIDTextureAdjuster_DEFINED
9 #define GrImageIDTextureAdjuster_DEFINED 9 #define GrImageIDTextureAdjuster_DEFINED
10 10
11 #include "GrTextureParamsAdjuster.h" 11 #include "GrTextureParamsAdjuster.h"
12 #include "SkImage.h" 12 #include "SkImage.h"
13 13
14 class SkBitmap; 14 class SkBitmap;
15 class SkImage_Base; 15 class SkImage_Base;
16 class SkImageCacherator; 16 class SkImageCacherator;
17 17
18 /** Implementation for texture-backed SkImages. The image must stay in scope and unmodified while
19 this object exists. */
20 class GrImageTextureAdjuster : public GrTextureAdjuster { 18 class GrImageTextureAdjuster : public GrTextureAdjuster {
21 public: 19 public:
22 explicit GrImageTextureAdjuster(const SkImage_Base* img); 20 explicit GrImageTextureAdjuster(const SkImage_Base* img);
23
24 protected:
25 SkColorSpace* getColorSpace() override;
26
27 private:
28 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
29
30 void didCacheCopy(const GrUniqueKey& copyKey) override;
31
32 const SkImage_Base* fImageBase;
33
34 typedef GrTextureAdjuster INHERITED;
35 }; 21 };
36 22
37 /** This class manages the conversion of SW-backed bitmaps to GrTextures. If the input bitmap is 23 /** This class manages the conversion of SW-backed bitmaps to GrTextures. If the input bitmap is
38 non-volatile the texture is cached using a key created from the pixels' imag e id and the 24 non-volatile the texture is cached using a key created from the pixels' imag e id and the
39 subset of the pixelref specified by the bitmap. */ 25 subset of the pixelref specified by the bitmap. */
40 class GrBitmapTextureMaker : public GrTextureMaker { 26 class GrBitmapTextureMaker : public GrTextureMaker {
41 public: 27 public:
42 GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap); 28 GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap);
43 29
44 protected: 30 protected:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 private: 64 private:
79 SkImageCacherator* fCacher; 65 SkImageCacherator* fCacher;
80 const SkImage* fClient; 66 const SkImage* fClient;
81 GrUniqueKey fOriginalKey; 67 GrUniqueKey fOriginalKey;
82 SkImage::CachingHint fCachingHint; 68 SkImage::CachingHint fCachingHint;
83 69
84 typedef GrTextureMaker INHERITED; 70 typedef GrTextureMaker INHERITED;
85 }; 71 };
86 72
87 #endif 73 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698