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

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: rebase with TOT Created 7 years, 8 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return (c & 0x00FFFFFF) | (a << 24); 182 return (c & 0x00FFFFFF) | (a << 24);
183 } 183 }
184 184
185 // PlatformContextSkia --------------------------------------------------------- 185 // PlatformContextSkia ---------------------------------------------------------
186 186
187 // Danger: canvas can be NULL. 187 // Danger: canvas can be NULL.
188 PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas) 188 PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas)
189 : m_canvas(canvas) 189 : m_canvas(canvas)
190 , m_deferredSaveFlags(0) 190 , m_deferredSaveFlags(0)
191 , m_trackOpaqueRegion(false) 191 , m_trackOpaqueRegion(false)
192 , m_trackTextRegion(false)
192 , m_printing(false) 193 , m_printing(false)
193 , m_accelerated(false) 194 , m_accelerated(false)
194 , m_drawingToImageBuffer(false) 195 , m_drawingToImageBuffer(false)
195 , m_deviceScaleFactor(1) 196 , m_deviceScaleFactor(1)
196 { 197 {
197 m_stateStack.append(State()); 198 m_stateStack.append(State());
198 m_state = &m_stateStack.last(); 199 m_state = &m_stateStack.last();
199 200
200 // will be assigned in setGraphicsContext() 201 // will be assigned in setGraphicsContext()
201 m_gc = 0; 202 m_gc = 0;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 // Our layers only have a single alpha channel. This means that subpixel 608 // Our layers only have a single alpha channel. This means that subpixel
608 // rendered text cannot be composited correctly when the layer is 609 // rendered text cannot be composited correctly when the layer is
609 // collapsed. Therefore, subpixel text is disabled when we are drawing 610 // collapsed. Therefore, subpixel text is disabled when we are drawing
610 // onto a layer. 611 // onto a layer.
611 if (isDrawingToLayer()) 612 if (isDrawingToLayer())
612 return false; 613 return false;
613 614
614 return m_gc->shouldSmoothFonts(); 615 return m_gc->shouldSmoothFonts();
615 } 616 }
616 617
618 void PlatformContextSkia::trackTextRegion(const SkRect& textRect)
619 {
620 if (m_trackTextRegion) {
621 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
622 m_textRegion.join(textRect);
eseidel 2013/04/18 21:04:38 I hope this isn't a WebCore::Region (which is abys
alokp 2013/04/18 22:22:37 Not WebCore::Region. It is SkRect (for now). I may
623 }
624 }
625
617 } // namespace WebCore 626 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698