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

Side by Side Diff: tests/GpuBitmapCopyTest.cpp

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/BitmapCopyTest.cpp ('k') | tests/Matrix44Test.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 SkAutoUnref aur(device); 132 SkAutoUnref aur(device);
133 src = device->accessBitmap(false); 133 src = device->accessBitmap(false);
134 device->clear(SK_ColorWHITE); 134 device->clear(SK_ColorWHITE);
135 135
136 // Draw something different to the same portion of the bitmap that w e will extract as a 136 // Draw something different to the same portion of the bitmap that w e will extract as a
137 // subset, so that comparing the pixels of the subset will be meanin gful. 137 // subset, so that comparing the pixels of the subset will be meanin gful.
138 SkIRect subsetRect = SkIRect::MakeLTRB(W/2, H/2, W, H); 138 SkIRect subsetRect = SkIRect::MakeLTRB(W/2, H/2, W, H);
139 SkCanvas drawingCanvas(device); 139 SkCanvas drawingCanvas(device);
140 SkPaint paint; 140 SkPaint paint;
141 paint.setColor(SK_ColorRED); 141 paint.setColor(SK_ColorRED);
142 drawingCanvas.drawRect(SkRect::MakeFromIRect(subsetRect), paint); 142 drawingCanvas.drawRect(SkRect::Make(subsetRect), paint);
143 143
144 // Extract a subset. If this succeeds we will test copying the subse t. 144 // Extract a subset. If this succeeds we will test copying the subse t.
145 SkBitmap subset; 145 SkBitmap subset;
146 const bool extracted = src.extractSubset(&subset, subsetRect); 146 const bool extracted = src.extractSubset(&subset, subsetRect);
147 147
148 for (size_t j = 0; j < SK_ARRAY_COUNT(gPairs); j++) { 148 for (size_t j = 0; j < SK_ARRAY_COUNT(gPairs); j++) {
149 dst.reset(); 149 dst.reset();
150 bool success = src.deepCopyTo(&dst, gPairs[j].fConfig); 150 bool success = src.deepCopyTo(&dst, gPairs[j].fConfig);
151 bool expected = gPairs[i].fValid[j] != '0'; 151 bool expected = gPairs[i].fValid[j] != '0';
152 if (success != expected) { 152 if (success != expected) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 } // for (size_t j = ... 189 } // for (size_t j = ...
190 } // for (size_t i = ... 190 } // for (size_t i = ...
191 } // GrContextFactory::GLContextType 191 } // GrContextFactory::GLContextType
192 } 192 }
193 193
194 #include "TestClassDef.h" 194 #include "TestClassDef.h"
195 DEFINE_GPUTESTCLASS("GpuBitmapCopy", TestGpuBitmapCopyClass, TestGpuBitmapCopy) 195 DEFINE_GPUTESTCLASS("GpuBitmapCopy", TestGpuBitmapCopyClass, TestGpuBitmapCopy)
196 196
197 #endif 197 #endif
OLDNEW
« no previous file with comments | « tests/BitmapCopyTest.cpp ('k') | tests/Matrix44Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698