This source file includes following definitions.
- m_opaque
- paintContents
#include "config.h"
#include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
#include "platform/EventTracer.h"
#include "platform/geometry/IntRect.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/transforms/AffineTransform.h"
#include "public/platform/WebFloatRect.h"
#include "public/platform/WebRect.h"
using blink::WebFloatRect;
using blink::WebRect;
namespace WebCore {
OpaqueRectTrackingContentLayerDelegate::OpaqueRectTrackingContentLayerDelegate(GraphicsContextPainter* painter)
: m_painter(painter)
, m_opaque(false)
{
}
OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate()
{
}
void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque)
{
static const unsigned char* annotationsEnabled = 0;
if (UNLIKELY(!annotationsEnabled))
annotationsEnabled = EventTracer::getTraceCategoryEnabledFlag(TRACE_DISABLED_BY_DEFAULT("blink.graphics_context_annotations"));
GraphicsContext context(canvas);
context.setTrackOpaqueRegion(!m_opaque);
context.setCertainlyOpaque(m_opaque);
context.setShouldSmoothFonts(canPaintLCDText);
if (*annotationsEnabled)
context.setAnnotationMode(AnnotateAll);
AffineTransform canvasToContentTransform = context.getCTM().inverse();
m_painter->paint(context, clip);
ASSERT(canvasToContentTransform.isInvertible());
ASSERT(canvasToContentTransform.preservesAxisAlignment());
opaque = canvasToContentTransform.mapRect(context.opaqueRegion().asRect());
}
}