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

Side by Side Diff: src/views/SkWindow.cpp

Issue 312553006: remove SkBounder -- unused and unloved (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 6 years, 6 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/utils/SkProxyCanvas.cpp ('k') | tests/CanvasTest.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 2011 Google Inc. 3 * Copyright 2011 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 #include "SkWindow.h" 8 #include "SkWindow.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
11 #include "SkOSMenu.h" 11 #include "SkOSMenu.h"
12 #include "SkSystemEventTypes.h" 12 #include "SkSystemEventTypes.h"
13 #include "SkTime.h" 13 #include "SkTime.h"
14 14
15 #define SK_EventDelayInval "\xd" "n" "\xa" "l" 15 #define SK_EventDelayInval "\xd" "n" "\xa" "l"
16 16
17 #define TEST_BOUNDERx
18
19 #include "SkBounder.h"
20 class TestSkBounder : public SkBounder {
21 public:
22 explicit TestSkBounder(const SkBitmap& bm) : fCanvas(bm) {}
23
24 protected:
25 virtual bool onIRect(const SkIRect& r) SK_OVERRIDE {
26 SkRect rr;
27
28 rr.set(SkIntToScalar(r.fLeft), SkIntToScalar(r.fTop),
29 SkIntToScalar(r.fRight), SkIntToScalar(r.fBottom));
30
31 SkPaint p;
32
33 p.setStyle(SkPaint::kStroke_Style);
34 p.setColor(SK_ColorYELLOW);
35
36 #if 0
37 rr.inset(SK_ScalarHalf, SK_ScalarHalf);
38 #else
39 rr.inset(-SK_ScalarHalf, -SK_ScalarHalf);
40 #endif
41
42 fCanvas.drawRect(rr, p);
43 return true;
44 }
45 private:
46 SkCanvas fCanvas;
47 };
48
49 SkWindow::SkWindow() : fFocusView(NULL) { 17 SkWindow::SkWindow() : fFocusView(NULL) {
50 fClicks.reset(); 18 fClicks.reset();
51 fWaitingOnInval = false; 19 fWaitingOnInval = false;
52 20
53 #ifdef SK_BUILD_FOR_WINCE 21 #ifdef SK_BUILD_FOR_WINCE
54 fColorType = kRGB_565_SkColorType; 22 fColorType = kRGB_565_SkColorType;
55 #else 23 #else
56 fColorType = kN32_SkColorType; 24 fColorType = kN32_SkColorType;
57 #endif 25 #endif
58 26
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (updateArea) 132 if (updateArea)
165 *updateArea = fDirtyRgn.getBounds(); 133 *updateArea = fDirtyRgn.getBounds();
166 134
167 SkAutoCanvasRestore acr(canvas, true); 135 SkAutoCanvasRestore acr(canvas, true);
168 canvas->concat(fMatrix); 136 canvas->concat(fMatrix);
169 137
170 // empty this now, so we can correctly record any inval calls that 138 // empty this now, so we can correctly record any inval calls that
171 // might be made during the draw call. 139 // might be made during the draw call.
172 fDirtyRgn.setEmpty(); 140 fDirtyRgn.setEmpty();
173 141
174 #ifdef TEST_BOUNDER
175 TestSkBounder bounder(bm);
176 canvas->setBounder(&bounder);
177 #endif
178 #ifdef SK_SIMULATE_FAILED_MALLOC 142 #ifdef SK_SIMULATE_FAILED_MALLOC
179 gEnableControlledThrow = true; 143 gEnableControlledThrow = true;
180 #endif 144 #endif
181 #ifdef SK_BUILD_FOR_WIN32 145 #ifdef SK_BUILD_FOR_WIN32
182 //try { 146 //try {
183 this->draw(canvas); 147 this->draw(canvas);
184 //} 148 //}
185 //catch (...) { 149 //catch (...) {
186 //} 150 //}
187 #else 151 #else
188 this->draw(canvas); 152 this->draw(canvas);
189 #endif 153 #endif
190 #ifdef SK_SIMULATE_FAILED_MALLOC 154 #ifdef SK_SIMULATE_FAILED_MALLOC
191 gEnableControlledThrow = false; 155 gEnableControlledThrow = false;
192 #endif 156 #endif
193 #ifdef TEST_BOUNDER
194 canvas->setBounder(NULL);
195 #endif
196 157
197 #if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN) 158 #if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN)
198 GXEndDraw(); 159 GXEndDraw();
199 #endif 160 #endif
200 161
201 return true; 162 return true;
202 } 163 }
203 return false; 164 return false;
204 } 165 }
205 166
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 fClicks.remove(index); 329 fClicks.remove(index);
369 handled = true; 330 handled = true;
370 } 331 }
371 break; 332 break;
372 default: 333 default:
373 // Do nothing 334 // Do nothing
374 break; 335 break;
375 } 336 }
376 return handled; 337 return handled;
377 } 338 }
OLDNEW
« no previous file with comments | « src/utils/SkProxyCanvas.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698