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

Side by Side Diff: Source/core/platform/graphics/skia/PlatformContextSkia.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: implemented TextRun wrapper Created 7 years, 7 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) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 int m_restoreCount; 61 int m_restoreCount;
62 }; 62 };
63 63
64 // PlatformContextSkia --------------------------------------------------------- 64 // PlatformContextSkia ---------------------------------------------------------
65 65
66 // Danger: canvas can be NULL. 66 // Danger: canvas can be NULL.
67 PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas) 67 PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas)
68 : m_canvas(canvas) 68 : m_canvas(canvas)
69 , m_deferredSaveFlags(0) 69 , m_deferredSaveFlags(0)
70 , m_trackOpaqueRegion(false) 70 , m_trackOpaqueRegion(false)
71 , m_trackTextRegion(false)
71 , m_printing(false) 72 , m_printing(false)
72 , m_accelerated(false) 73 , m_accelerated(false)
73 , m_drawingToImageBuffer(false) 74 , m_drawingToImageBuffer(false)
74 , m_deviceScaleFactor(1) 75 , m_deviceScaleFactor(1)
75 { 76 {
76 m_stateStack.append(PlatformContextSkiaState()); 77 m_stateStack.append(PlatformContextSkiaState());
77 m_state = &m_stateStack.last(); 78 m_state = &m_stateStack.last();
78 79
79 // will be assigned in setGraphicsContext() 80 // will be assigned in setGraphicsContext()
80 m_gc = 0; 81 m_gc = 0;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // Our layers only have a single alpha channel. This means that subpixel 487 // Our layers only have a single alpha channel. This means that subpixel
487 // rendered text cannot be composited correctly when the layer is 488 // rendered text cannot be composited correctly when the layer is
488 // collapsed. Therefore, subpixel text is disabled when we are drawing 489 // collapsed. Therefore, subpixel text is disabled when we are drawing
489 // onto a layer. 490 // onto a layer.
490 if (isDrawingToLayer()) 491 if (isDrawingToLayer())
491 return false; 492 return false;
492 493
493 return m_gc->shouldSmoothFonts(); 494 return m_gc->shouldSmoothFonts();
494 } 495 }
495 496
497 void PlatformContextSkia::didDrawTextInRect(const SkRect& textRect)
498 {
499 if (m_trackTextRegion) {
500 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
501 m_textRegion.join(textRect);
502 }
503 }
504
496 } // namespace WebCore 505 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698