OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "gm.h" | 8 #include "gm.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 * than the layer. Because the clip will contain the layer's bounds, no draw
s will be full-RT. | 121 * than the layer. Because the clip will contain the layer's bounds, no draw
s will be full-RT. |
122 * So when running on a GPU canvas we explicitly create a temporary canvas u
sing a texture with | 122 * So when running on a GPU canvas we explicitly create a temporary canvas u
sing a texture with |
123 * dimensions exactly matching the layer size. | 123 * dimensions exactly matching the layer size. |
124 */ | 124 */ |
125 SkSurface* possiblyCreateTempSurface(SkCanvas* baseCanvas, int w, int h) { | 125 SkSurface* possiblyCreateTempSurface(SkCanvas* baseCanvas, int w, int h) { |
126 #if SK_SUPPORT_GPU | 126 #if SK_SUPPORT_GPU |
127 GrContext* context = baseCanvas->getGrContext(); | 127 GrContext* context = baseCanvas->getGrContext(); |
128 SkImageInfo baseInfo = baseCanvas->imageInfo(); | 128 SkImageInfo baseInfo = baseCanvas->imageInfo(); |
129 SkImageInfo info = SkImageInfo::Make(w, h, baseInfo.colorType(), baseInf
o.alphaType(), | 129 SkImageInfo info = SkImageInfo::Make(w, h, baseInfo.colorType(), baseInf
o.alphaType(), |
130 baseInfo.profileType()); | 130 baseInfo.profileType()); |
131 return SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info
, 0, nullptr); | 131 return SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info, 0, nul
lptr); |
132 #else | 132 #else |
133 return nullptr; | 133 return nullptr; |
134 #endif | 134 #endif |
135 } | 135 } |
136 | 136 |
137 void drawMode(SkCanvas* canvas, | 137 void drawMode(SkCanvas* canvas, |
138 int x, int y, int w, int h, | 138 int x, int y, int w, int h, |
139 const SkPaint& modePaint, SkSurface* surface) { | 139 const SkPaint& modePaint, SkSurface* surface) { |
140 canvas->save(); | 140 canvas->save(); |
141 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); | 141 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 SkAutoTUnref<SkShader> fBmpShader; | 225 SkAutoTUnref<SkShader> fBmpShader; |
226 | 226 |
227 typedef GM INHERITED; | 227 typedef GM INHERITED; |
228 }; | 228 }; |
229 | 229 |
230 ////////////////////////////////////////////////////////////////////////////// | 230 ////////////////////////////////////////////////////////////////////////////// |
231 | 231 |
232 DEF_GM(return new Xfermodes3GM;) | 232 DEF_GM(return new Xfermodes3GM;) |
233 | 233 |
234 } | 234 } |
OLD | NEW |