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

Side by Side Diff: experimental/AndroidPathRenderer/AndroidPathRenderer.cpp

Issue 196133033: replace old SK_TRACE_EVENT macros with new TRACE_EVENT ones (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | gyp/core.gypi » ('j') | src/gpu/GrContext.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 #define LOG_TAG "PathRenderer" 8 #define LOG_TAG "PathRenderer"
9 #define LOG_NDEBUG 1 9 #define LOG_NDEBUG 1
10 #define ATRACE_TAG ATRACE_TAG_GRAPHICS 10 #define ATRACE_TAG ATRACE_TAG_GRAPHICS
11 11
12 #define VERTEX_DEBUG 0 12 #define VERTEX_DEBUG 0
13 13
14 #include <SkPath.h> 14 #include <SkPath.h>
15 #include <SkStrokeRec.h> 15 #include <SkStrokeRec.h>
16 16
17 #include <stdlib.h> 17 #include <stdlib.h>
18 #include <stdint.h> 18 #include <stdint.h>
19 #include <sys/types.h> 19 #include <sys/types.h>
20 20
21 #include <SkTypes.h> 21 #include <SkTypes.h>
22 #include <SkTrace.h> 22 #include <SkTraceEvent.h>
23 #include <SkMatrix.h> 23 #include <SkMatrix.h>
24 #include <SkPoint.h> 24 #include <SkPoint.h>
25 25
26 #ifdef VERBOSE 26 #ifdef VERBOSE
27 #define ALOGV SkDebugf 27 #define ALOGV SkDebugf
28 #else 28 #else
29 #define ALOGV(x, ...) 29 #define ALOGV(x, ...)
30 #endif 30 #endif
31 31
32 #include "AndroidPathRenderer.h" 32 #include "AndroidPathRenderer.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 #if VERTEX_DEBUG 516 #if VERTEX_DEBUG
517 for (unsigned int i = 0; i < vertexBuffer.getSize(); i++) { 517 for (unsigned int i = 0; i < vertexBuffer.getSize(); i++) {
518 SkDebugf("point at %f %f, alpha %f", buffer[i].position[0], buffer[i].po sition[1], buffer[i].alpha); 518 SkDebugf("point at %f %f, alpha %f", buffer[i].position[0], buffer[i].po sition[1], buffer[i].alpha);
519 } 519 }
520 #endif 520 #endif
521 } 521 }
522 522
523 void PathRenderer::ConvexPathVertices(const SkPath &path, const SkStrokeRec& str oke, bool isAA, 523 void PathRenderer::ConvexPathVertices(const SkPath &path, const SkStrokeRec& str oke, bool isAA,
524 const SkMatrix* transform, VertexBuffer* vertexBuffer) { 524 const SkMatrix* transform, VertexBuffer* vertexBuffer) {
525 SK_TRACE_EVENT0("PathRenderer::convexPathVertices"); 525 TRACE_EVENT0("skia", "PathRenderer::convexPathVertices");
526 526
527 SkStrokeRec::Style style = stroke.getStyle(); 527 SkStrokeRec::Style style = stroke.getStyle();
528 528
529 float inverseScaleX, inverseScaleY; 529 float inverseScaleX, inverseScaleY;
530 computeInverseScales(transform, inverseScaleX, inverseScaleY); 530 computeInverseScales(transform, inverseScaleX, inverseScaleY);
531 531
532 SkTArray<Vertex, true> tempVertices; 532 SkTArray<Vertex, true> tempVertices;
533 float threshInvScaleX = inverseScaleX; 533 float threshInvScaleX = inverseScaleX;
534 float threshInvScaleY = inverseScaleY; 534 float threshInvScaleY = inverseScaleY;
535 if (style == SkStrokeRec::kStroke_Style) { 535 if (style == SkStrokeRec::kStroke_Style) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 591
592 static void pushToVector(SkTArray<Vertex, true>* vertices, float x, float y) { 592 static void pushToVector(SkTArray<Vertex, true>* vertices, float x, float y) {
593 // TODO: make this not yuck 593 // TODO: make this not yuck
594 vertices->push_back(); 594 vertices->push_back();
595 Vertex* newVertex = &((*vertices)[vertices->count() - 1]); 595 Vertex* newVertex = &((*vertices)[vertices->count() - 1]);
596 Vertex::set(newVertex, x, y); 596 Vertex::set(newVertex, x, y);
597 } 597 }
598 598
599 bool PathRenderer::ConvexPathPerimeterVertices(const SkPath& path, bool forceClo se, 599 bool PathRenderer::ConvexPathPerimeterVertices(const SkPath& path, bool forceClo se,
600 float sqrInvScaleX, float sqrInvScaleY, SkTArray<Vertex, true>* outputVe rtices) { 600 float sqrInvScaleX, float sqrInvScaleY, SkTArray<Vertex, true>* outputVe rtices) {
601 SK_TRACE_EVENT0("PathRenderer::convexPathPerimeterVertices"); 601 TRACE_EVENT0("skia", "PathRenderer::convexPathPerimeterVertices");
602 602
603 603
604 // TODO: to support joins other than sharp miter, join vertices should be la belled in the 604 // TODO: to support joins other than sharp miter, join vertices should be la belled in the
605 // perimeter, or resolved into more vertices. Reconsider forceClose-ing in t hat case. 605 // perimeter, or resolved into more vertices. Reconsider forceClose-ing in t hat case.
606 SkPath::Iter iter(path, forceClose); 606 SkPath::Iter iter(path, forceClose);
607 SkPoint pts[4]; 607 SkPoint pts[4];
608 SkPath::Verb v; 608 SkPath::Verb v;
609 609
610 while (SkPath::kDone_Verb != (v = iter.next(pts))) { 610 while (SkPath::kDone_Verb != (v = iter.next(pts))) {
611 switch (v) { 611 switch (v) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 722
723 RecursiveQuadraticBezierVertices(ax, ay, mx, my, acx, acy, 723 RecursiveQuadraticBezierVertices(ax, ay, mx, my, acx, acy,
724 sqrInvScaleX, sqrInvScaleY, outputVertices); 724 sqrInvScaleX, sqrInvScaleY, outputVertices);
725 RecursiveQuadraticBezierVertices(mx, my, bx, by, bcx, bcy, 725 RecursiveQuadraticBezierVertices(mx, my, bx, by, bcx, bcy,
726 sqrInvScaleX, sqrInvScaleY, outputVertices); 726 sqrInvScaleX, sqrInvScaleY, outputVertices);
727 } 727 }
728 } 728 }
729 729
730 }; // namespace uirenderer 730 }; // namespace uirenderer
731 }; // namespace android 731 }; // namespace android
OLDNEW
« no previous file with comments | « no previous file | gyp/core.gypi » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698