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

Side by Side Diff: gm/texdata.cpp

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash Created 4 years, 7 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 | include/gpu/GrClip.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 2011 Google Inc. 2 * Copyright 2011 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 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 desc.fHeight = 2 * S; 75 desc.fHeight = 2 * S;
76 GrTexture* texture = context->textureProvider()->createTexture( 76 GrTexture* texture = context->textureProvider()->createTexture(
77 desc, SkBudgeted::kNo, gTextureData.get(), 0); 77 desc, SkBudgeted::kNo, gTextureData.get(), 0);
78 78
79 if (!texture) { 79 if (!texture) {
80 return; 80 return;
81 } 81 }
82 SkAutoTUnref<GrTexture> au(texture); 82 SkAutoTUnref<GrTexture> au(texture);
83 83
84 // setup new clip 84 // setup new clip
85 GrClip clip(SkRect::MakeWH(2*S, 2*S)); 85 GrFixedClip clip(SkIRect::MakeWH(2*S, 2*S));
86 86
87 GrPaint paint; 87 GrPaint paint;
88 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode); 88 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode);
89 89
90 SkMatrix vm; 90 SkMatrix vm;
91 if (i) { 91 if (i) {
92 vm.setRotate(90 * SK_Scalar1, 92 vm.setRotate(90 * SK_Scalar1,
93 S * SK_Scalar1, 93 S * SK_Scalar1,
94 S * SK_Scalar1); 94 S * SK_Scalar1);
95 } else { 95 } else {
(...skipping 16 matching lines...) Expand all
112 } 112 }
113 } 113 }
114 texture->writePixels(S, (i ? 0 : S), S, S, 114 texture->writePixels(S, (i ? 0 : S), S, S,
115 texture->config(), gTextureData.get(), 115 texture->config(), gTextureData.get(),
116 4 * stride); 116 4 * stride);
117 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); 117 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S));
118 } 118 }
119 } 119 }
120 #endif 120 #endif
121 121
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698