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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 587793003: enable conservative clips for gpudevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | src/gpu/SkGpuDevice.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 #include "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 static const SkScalar gAnimPeriod = 10 * SK_Scalar1; 1400 static const SkScalar gAnimPeriod = 10 * SK_Scalar1;
1401 static const SkScalar gAnimMag = SK_Scalar1 / 1000; 1401 static const SkScalar gAnimMag = SK_Scalar1 / 1000;
1402 SkScalar t = SkScalarMod(fPerspAnimTime, gAnimPeriod); 1402 SkScalar t = SkScalarMod(fPerspAnimTime, gAnimPeriod);
1403 if (SkScalarFloorToInt(SkScalarDiv(fPerspAnimTime, gAnimPeriod)) & 0x1) { 1403 if (SkScalarFloorToInt(SkScalarDiv(fPerspAnimTime, gAnimPeriod)) & 0x1) {
1404 t = gAnimPeriod - t; 1404 t = gAnimPeriod - t;
1405 } 1405 }
1406 t = 2 * t - gAnimPeriod; 1406 t = 2 * t - gAnimPeriod;
1407 t = SkScalarMul(SkScalarDiv(t, gAnimPeriod), gAnimMag); 1407 t = SkScalarMul(SkScalarDiv(t, gAnimPeriod), gAnimMag);
1408 SkMatrix m; 1408 SkMatrix m;
1409 m.reset(); 1409 m.reset();
1410 #if 1
1410 m.setPerspY(t); 1411 m.setPerspY(t);
1412 #else
1413 m.setPerspY(SK_Scalar1 / 1000);
1414 m.setSkewX(SkScalarDiv(8, 25));
1415 m.dump();
1416 #endif
1411 canvas->concat(m); 1417 canvas->concat(m);
1412 } 1418 }
1413 1419
1414 this->installDrawFilter(canvas); 1420 this->installDrawFilter(canvas);
1415 1421
1416 if (fMeasureFPS) { 1422 if (fMeasureFPS) {
1417 if (SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT)) { 1423 if (SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT)) {
1418 fMeasureFPS_StartTime = SkTime::GetMSecs(); 1424 fMeasureFPS_StartTime = SkTime::GetMSecs();
1419 } 1425 }
1420 } else { 1426 } else {
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2393 setenv("ANDROID_ROOT", "/android/device/data", 0); 2399 setenv("ANDROID_ROOT", "/android/device/data", 0);
2394 #endif 2400 #endif
2395 SkGraphics::Init(); 2401 SkGraphics::Init();
2396 SkEvent::Init(); 2402 SkEvent::Init();
2397 } 2403 }
2398 2404
2399 void application_term() { 2405 void application_term() {
2400 SkEvent::Term(); 2406 SkEvent::Term();
2401 SkGraphics::Term(); 2407 SkGraphics::Term();
2402 } 2408 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698