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

Side by Side Diff: src/utils/SkImageGeneratorUtils.cpp

Issue 1397123002: Move functions from SkGr to SkGrPriv.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 9th time's a charm? Created 5 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 | « src/image/SkImage_Gpu.cpp ('k') | src/views/SkWindow.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 #include "SkImageGeneratorUtils.h" 8 #include "SkImageGeneratorUtils.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 10
(...skipping 29 matching lines...) Expand all
40 SkImageGenerator* SkImageGeneratorUtils::NewFromBitmap(const SkBitmap& bm) { 40 SkImageGenerator* SkImageGeneratorUtils::NewFromBitmap(const SkBitmap& bm) {
41 return new GeneratorFromBitmap(bm); 41 return new GeneratorFromBitmap(bm);
42 } 42 }
43 43
44 //////////////////////////////////////////////////////////////////////////////// /////////////////// 44 //////////////////////////////////////////////////////////////////////////////// ///////////////////
45 45
46 #if SK_SUPPORT_GPU 46 #if SK_SUPPORT_GPU
47 47
48 #include "GrContext.h" 48 #include "GrContext.h"
49 #include "GrTexture.h" 49 #include "GrTexture.h"
50 #include "SkGr.h" 50 #include "SkGrPriv.h"
51 51
52 class GeneratorFromTexture : public SkImageGenerator { 52 class GeneratorFromTexture : public SkImageGenerator {
53 public: 53 public:
54 GeneratorFromTexture(GrContext* ctx, GrTexture* tex, const SkImageInfo& info ) 54 GeneratorFromTexture(GrContext* ctx, GrTexture* tex, const SkImageInfo& info )
55 : SkImageGenerator(info), fCtx(ctx), fTexture(tex) 55 : SkImageGenerator(info), fCtx(ctx), fTexture(tex)
56 {} 56 {}
57 57
58 protected: 58 protected:
59 GrTexture* onGenerateTexture(GrContext* ctx, SkImageUsageType, const SkIRect * subset) override { 59 GrTexture* onGenerateTexture(GrContext* ctx, SkImageUsageType, const SkIRect * subset) override {
60 if (ctx) { 60 if (ctx) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (image) { 125 if (image) {
126 const SkColorType ct = kN32_SkColorType; 126 const SkColorType ct = kN32_SkColorType;
127 const SkAlphaType at = image->isOpaque() ? kOpaque_SkAlphaType : kPremul _SkAlphaType; 127 const SkAlphaType at = image->isOpaque() ? kOpaque_SkAlphaType : kPremul _SkAlphaType;
128 const SkImageInfo info = SkImageInfo::Make(image->width(), image->height (), ct, at); 128 const SkImageInfo info = SkImageInfo::Make(image->width(), image->height (), ct, at);
129 return new GeneratorFromImage(image, info); 129 return new GeneratorFromImage(image, info);
130 } 130 }
131 return nullptr; 131 return nullptr;
132 } 132 }
133 133
134 134
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/views/SkWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698