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

Side by Side Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 204093002: GraphicsContext culling support. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop GC cull stack, misc fixes. 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 void GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegi on::Op op) 1518 void GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegi on::Op op)
1519 { 1519 {
1520 if (paintingDisabled()) 1520 if (paintingDisabled())
1521 return; 1521 return;
1522 1522
1523 realizeCanvasSave(SkCanvas::kClip_SaveFlag); 1523 realizeCanvasSave(SkCanvas::kClip_SaveFlag);
1524 1524
1525 m_canvas->clipRRect(rect, op, aa == AntiAliased); 1525 m_canvas->clipRRect(rect, op, aa == AntiAliased);
1526 } 1526 }
1527 1527
1528 void GraphicsContext::beginCull(const FloatRect& rect)
1529 {
1530 if (paintingDisabled())
1531 return;
1532
1533 realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag);
1534 m_canvas->pushCull(rect);
1535 }
1536
1537 void GraphicsContext::endCull()
1538 {
1539 if (paintingDisabled())
1540 return;
1541
1542 realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag);
1543
1544 m_canvas->popCull();
1545 }
1546
1528 void GraphicsContext::rotate(float angleInRadians) 1547 void GraphicsContext::rotate(float angleInRadians)
1529 { 1548 {
1530 if (paintingDisabled()) 1549 if (paintingDisabled())
1531 return; 1550 return;
1532 1551
1533 realizeCanvasSave(SkCanvas::kMatrix_SaveFlag); 1552 realizeCanvasSave(SkCanvas::kMatrix_SaveFlag);
1534 1553
1535 m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.1415926 5f))); 1554 m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.1415926 5f)));
1536 } 1555 }
1537 1556
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 1904
1886 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) 1905 void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
1887 { 1906 {
1888 if (m_trackTextRegion) { 1907 if (m_trackTextRegion) {
1889 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); 1908 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
1890 m_textRegion.join(textRect); 1909 m_textRegion.join(textRect);
1891 } 1910 }
1892 } 1911 }
1893 1912
1894 } 1913 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698