这篇教程C++ DCHECK函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DCHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ DCHECK函数的具体用法?C++ DCHECK怎么用?C++ DCHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DCHECK函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: fillWithNulls /** * @brief Fill this entire ColumnVector with NULLs. **/ inline void fillWithNulls() { DCHECK(null_bitmap_); null_bitmap_->setBitRange(0, reserved_length_, true); actual_length_ = reserved_length_; }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:8,
示例2: BoxPaintervoid BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) { const PaintPhase paintPhase = paintInfo.phase; if (shouldPaintSelfBlockBackground(paintPhase)) { if (m_layoutBlock.style()->visibility() == EVisibility::Visible && m_layoutBlock.hasBoxDecorationBackground()) m_layoutBlock.paintBoxDecorationBackground(paintInfo, paintOffset); // We're done. We don't bother painting any children. if (paintPhase == PaintPhaseSelfBlockBackgroundOnly) return; } if (paintInfo.paintRootBackgroundOnly()) return; if (paintPhase == PaintPhaseMask && m_layoutBlock.style()->visibility() == EVisibility::Visible) { m_layoutBlock.paintMask(paintInfo, paintOffset); return; } if (paintPhase == PaintPhaseClippingMask && m_layoutBlock.style()->visibility() == EVisibility::Visible) { BoxPainter(m_layoutBlock).paintClippingMask(paintInfo, paintOffset); return; } if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffset); if (paintPhase != PaintPhaseSelfOutlineOnly) { Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; Optional<ScrollRecorder> scrollRecorder; Optional<PaintInfo> scrolledPaintInfo; if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { const auto* objectProperties = m_layoutBlock.paintProperties(); if (auto* scroll = objectProperties ? objectProperties->scroll() : nullptr) { PaintChunkProperties properties(paintInfo.context.getPaintController() .currentPaintChunkProperties()); auto* scrollTranslation = objectProperties->scrollTranslation(); DCHECK(scrollTranslation); properties.transform = scrollTranslation; properties.scroll = scroll; m_scopedScrollProperty.emplace( paintInfo.context.getPaintController(), m_layoutBlock, DisplayItem::paintPhaseToDrawingType(paintPhase), properties); scrolledPaintInfo.emplace(paintInfo); scrolledPaintInfo->updateCullRect( scrollTranslation->matrix().toAffineTransform()); } } else if (m_layoutBlock.hasOverflowClip()) { IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPhase, scrollOffset); scrolledPaintInfo.emplace(paintInfo); AffineTransform transform; transform.translate(-scrollOffset.width(), -scrollOffset.height()); scrolledPaintInfo->updateCullRect(transform); } } const PaintInfo& contentsPaintInfo = scrolledPaintInfo ? *scrolledPaintInfo : paintInfo; if (m_layoutBlock.isLayoutBlockFlow()) { BlockFlowPainter blockFlowPainter(toLayoutBlockFlow(m_layoutBlock)); blockFlowPainter.paintContents(contentsPaintInfo, paintOffset); if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) blockFlowPainter.paintFloats(contentsPaintInfo, paintOffset); } else { paintContents(contentsPaintInfo, paintOffset); } } if (shouldPaintSelfOutline(paintPhase)) ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset); // If the caret's node's layout object's containing block is this block, and // the paint action is PaintPhaseForeground, then paint the caret. if (paintPhase == PaintPhaseForeground && m_layoutBlock.hasCaret()) paintCarets(paintInfo, paintOffset);}
开发者ID:mirror,项目名称:chromium,代码行数:86,
示例3: DCHECK// staticbool HTMLIFrameElementPayments::fastHasAttribute( const QualifiedName& name, const HTMLIFrameElement& element) { DCHECK(name == HTMLNames::allowpaymentrequestAttr); return element.fastHasAttribute(name);}
开发者ID:mirror,项目名称:chromium,代码行数:7,
示例4: DCHECKbool WebImageDecoder::isFailed() const { DCHECK(m_private); return m_private->failed();}
开发者ID:ollie314,项目名称:chromium,代码行数:4,
示例5: DCHECKbool SelectionModifier::modify(EAlteration alter, SelectionDirection direction, TextGranularity granularity) { DCHECK(!frame()->document()->needsLayoutTreeUpdate()); DocumentLifecycle::DisallowTransitionScope disallowTransition( frame()->document()->lifecycle()); willBeModified(alter, direction); bool wasRange = m_selection.isRange(); VisiblePosition originalStartPosition = m_selection.visibleStart(); VisiblePosition position; switch (direction) { case DirectionRight: if (alter == FrameSelection::AlterationMove) position = modifyMovingRight(granularity); else position = modifyExtendingRight(granularity); break; case DirectionForward: if (alter == FrameSelection::AlterationExtend) position = modifyExtendingForward(granularity); else position = modifyMovingForward(granularity); break; case DirectionLeft: if (alter == FrameSelection::AlterationMove) position = modifyMovingLeft(granularity); else position = modifyExtendingLeft(granularity); break; case DirectionBackward: if (alter == FrameSelection::AlterationExtend) position = modifyExtendingBackward(granularity); else position = modifyMovingBackward(granularity); break; } if (position.isNull()) return false; if (isSpatialNavigationEnabled(frame())) { if (!wasRange && alter == FrameSelection::AlterationMove && position.deepEquivalent() == originalStartPosition.deepEquivalent()) return false; } // Some of the above operations set an xPosForVerticalArrowNavigation. // Setting a selection will clear it, so save it to possibly restore later. // Note: the START position type is arbitrary because it is unused, it would // be the requested position type if there were no // xPosForVerticalArrowNavigation set. LayoutUnit x = lineDirectionPointForBlockDirectionNavigation(START); m_selection.setIsDirectional(shouldAlwaysUseDirectionalSelection(frame()) || alter == FrameSelection::AlterationExtend); switch (alter) { case FrameSelection::AlterationMove: m_selection = createVisibleSelection( SelectionInDOMTree::Builder() .collapse(position.toPositionWithAffinity()) .setIsDirectional(m_selection.isDirectional()) .build()); break; case FrameSelection::AlterationExtend: if (!m_selection.isCaret() && (granularity == WordGranularity || granularity == ParagraphGranularity || granularity == LineGranularity) && frame() && !frame() ->editor() .behavior() .shouldExtendSelectionByWordOrLineAcrossCaret()) { // Don't let the selection go across the base position directly. Needed // to match mac behavior when, for instance, word-selecting backwards // starting with the caret in the middle of a word and then // word-selecting forward, leaving the caret in the same place where it // was, instead of directly selecting to the end of the word. VisibleSelection newSelection = m_selection; newSelection.setExtent(position); if (m_selection.isBaseFirst() != newSelection.isBaseFirst()) position = m_selection.visibleBase(); } // Standard Mac behavior when extending to a boundary is grow the // selection rather than leaving the base in place and moving the // extent. Matches NSTextView. if (!frame() || !frame() ->editor() .behavior() .shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity)) { m_selection.setExtent(position); } else { TextDirection textDirection = directionOfEnclosingBlock(); if (direction == DirectionForward || (textDirection == LTR && direction == DirectionRight) ||//.........这里部分代码省略.........
开发者ID:mirror,项目名称:chromium,代码行数:101,
示例6: positionalWriteTypedValue /** * @brief Overwrite the value at the specified position with the supplied * TypedValue. * @warning You must call prepareForPositionalWrites() BEFORE calling this * method. * @warning Do NOT use positional writes in combination with appends. * * @param position The position of the value in this IndirectColumnVector to * overwrite. * @param value A TypedValue to write into this IndirectColumnVector. **/ inline void positionalWriteTypedValue(const std::size_t position, TypedValue &&value) { // NOLINT(whitespace/operators) DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); DCHECK_LT(position, values_.size()); values_[position] = std::move(value); }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:17,
示例7: prepareForPositionalWrites /** * @brief Prepare this IndirectColumnVector for positional writes. * Effectively "fills" this IndirectColumnVector with uninitialized * values that will be overwritten with calls to * positionalWriteTypedValue(). * @warning Do NOT use positional writes in combination with appends. **/ inline void prepareForPositionalWrites() { DCHECK(values_.empty()); values_.resize(reserved_length_); }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:11,
示例8: fillWithValue /** * @brief Fill this entire ColumnVector with copies of value. * * @param value A value to fill this ColumnVector with. **/ inline void fillWithValue(const TypedValue &value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); values_.assign(reserved_length_, value); }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:9,
示例9: appendTypedValue /** * @brief Append a TypedValue to this IndirectColumnVector. * * @param value A value to append to this NativeColumnVector. **/ inline void appendTypedValue(TypedValue &&value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); DCHECK_LT(values_.size(), reserved_length_); values_.emplace_back(std::move(value)); }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:10,
示例10: positionalWriteNullValue /** * @brief Overwrite the value at the specified position with a NULL value. * @warning You must call prepareForPositionalWrites() BEFORE calling this * method. * @warning Do NOT use positional writes in combination with appends. * @warning It is intended that this and other positional write methods * should be called exactly once for each position (if this is * violated, NULLs may not be tracked properly). * * @param position The position of the value in this NativeColumnVector to * overwrite with a NULL value. **/ inline void positionalWriteNullValue(const std::size_t position) { DCHECK_LT(position, actual_length_); DCHECK(null_bitmap_); null_bitmap_->setBit(position, true); }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:17,
示例11: DCHECKbool CSSStyleSheet::sheetLoaded() { DCHECK(m_ownerNode); setLoadCompleted(m_ownerNode->sheetLoaded()); return m_loadCompleted;}
开发者ID:mirror,项目名称:chromium,代码行数:5,
示例12: parseToNumberOrNaNvoid RangeInputType::handleKeydownEvent(KeyboardEvent* event) { if (element().isDisabledOrReadOnly()) return; const String& key = event->key(); const Decimal current = parseToNumberOrNaN(element().value()); DCHECK(current.isFinite()); StepRange stepRange(createStepRange(RejectAny)); // FIXME: We can't use stepUp() for the step value "any". So, we increase // or decrease the value by 1/100 of the value range. Is it reasonable? const Decimal step = equalIgnoringCase(element().fastGetAttribute(stepAttr), "any") ? (stepRange.maximum() - stepRange.minimum()) / 100 : stepRange.step(); const Decimal bigStep = std::max((stepRange.maximum() - stepRange.minimum()) / 10, step); TextDirection dir = LTR; bool isVertical = false; if (element().layoutObject()) { dir = computedTextDirection(); ControlPart part = element().layoutObject()->style()->appearance(); isVertical = part == SliderVerticalPart; } Decimal newValue; if (key == "ArrowUp") newValue = current + step; else if (key == "ArrowDown") newValue = current - step; else if (key == "ArrowLeft") newValue = (isVertical || dir == RTL) ? current + step : current - step; else if (key == "ArrowRight") newValue = (isVertical || dir == RTL) ? current - step : current + step; else if (key == "PageUp") newValue = current + bigStep; else if (key == "PageDown") newValue = current - bigStep; else if (key == "Home") newValue = isVertical ? stepRange.maximum() : stepRange.minimum(); else if (key == "End") newValue = isVertical ? stepRange.minimum() : stepRange.maximum(); else return; // Did not match any key binding. newValue = stepRange.clampValue(newValue); if (newValue != current) { EventQueueScope scope; TextFieldEventBehavior eventBehavior = DispatchInputAndChangeEvent; setValueAsDecimal(newValue, eventBehavior, IGNORE_EXCEPTION); if (AXObjectCache* cache = element().document().existingAXObjectCache()) cache->handleValueChanged(&element()); } event->setDefaultHandled();}
开发者ID:ollie314,项目名称:chromium,代码行数:61,
示例13: DCHECK void OutputWidget::addChild(FastoObject* child) { DCHECK(child->parent()); FastoObjectCommand* command = dynamic_cast<FastoObjectCommand*>(child); if(command){ return; } command = dynamic_cast<FastoObjectCommand*>(child->parent()); if(command){ void* parentinner = command->parent(); QModelIndex parent; bool isFound = commonModel_->findItem(parentinner, parent); if(!isFound){ return; } fastoredis::FastoCommonItem* par = NULL; if(!parent.isValid()){ par = static_cast<fastoredis::FastoCommonItem*>(commonModel_->root()); } else{ par = common::utils_qt::item<fastoredis::FastoCommonItem*>(parent); } DCHECK(par); if(!par){ return; } const QString key = common::convertFromString<QString>(command->inputArgs()); fastoredis::FastoCommonItem* comChild = createItem(par, key, child); comChild->setChangeCommand(command->oppositeCommand()); commonModel_->insertItem(parent, comChild); } else{ FastoObjectArray* arr = dynamic_cast<FastoObjectArray*>(child->parent()); if(arr){ QModelIndex parent; bool isFound = commonModel_->findItem(arr, parent); if(!isFound){ return; } fastoredis::FastoCommonItem* par = NULL; if(!parent.isValid()){ par = static_cast<fastoredis::FastoCommonItem*>(commonModel_->root()); } else{ par = common::utils_qt::item<fastoredis::FastoCommonItem*>(parent); } DCHECK(par); if(!par){ return; } fastoredis::FastoCommonItem* comChild = createItem(par, QString(), child); commonModel_->insertItem(parent, comChild); } else{ NOTREACHED(); } } }
开发者ID:TakedWind,项目名称:fastoredis,代码行数:69,
示例14: sortBlockstatic void sortBlock(unsigned from, unsigned to, HeapVector<NodeSetVector>& parentMatrix, bool mayContainAttributeNodes) { // Should not call this function with less that two nodes to sort. DCHECK_LT(from + 1, to); unsigned minDepth = UINT_MAX; for (unsigned i = from; i < to; ++i) { unsigned depth = parentMatrix[i].size() - 1; if (minDepth > depth) minDepth = depth; } // Find the common ancestor. unsigned commonAncestorDepth = minDepth; Node* commonAncestor; while (true) { commonAncestor = parentWithDepth(commonAncestorDepth, parentMatrix[from]); if (commonAncestorDepth == 0) break; bool allEqual = true; for (unsigned i = from + 1; i < to; ++i) { if (commonAncestor != parentWithDepth(commonAncestorDepth, parentMatrix[i])) { allEqual = false; break; } } if (allEqual) break; --commonAncestorDepth; } if (commonAncestorDepth == minDepth) { // One of the nodes is the common ancestor => it is the first in // document order. Find it and move it to the beginning. for (unsigned i = from; i < to; ++i) { if (commonAncestor == parentMatrix[i][0]) { parentMatrix[i].swap(parentMatrix[from]); if (from + 2 < to) sortBlock(from + 1, to, parentMatrix, mayContainAttributeNodes); return; } } } if (mayContainAttributeNodes && commonAncestor->isElementNode()) { // The attribute nodes and namespace nodes of an element occur before // the children of the element. The namespace nodes are defined to occur // before the attribute nodes. The relative order of namespace nodes is // implementation-dependent. The relative order of attribute nodes is // implementation-dependent. unsigned sortedEnd = from; // FIXME: namespace nodes are not implemented. for (unsigned i = sortedEnd; i < to; ++i) { Node* n = parentMatrix[i][0]; if (n->isAttributeNode() && toAttr(n)->ownerElement() == commonAncestor) parentMatrix[i].swap(parentMatrix[sortedEnd++]); } if (sortedEnd != from) { if (to - sortedEnd > 1) sortBlock(sortedEnd, to, parentMatrix, mayContainAttributeNodes); return; } } // Children nodes of the common ancestor induce a subdivision of our // node-set. Sort it according to this subdivision, and recursively sort // each group. HeapHashSet<Member<Node>> parentNodes; for (unsigned i = from; i < to; ++i) parentNodes.add(parentWithDepth(commonAncestorDepth + 1, parentMatrix[i])); unsigned previousGroupEnd = from; unsigned groupEnd = from; for (Node* n = commonAncestor->firstChild(); n; n = n->nextSibling()) { // If parentNodes contains the node, perform a linear search to move its // children in the node-set to the beginning. if (parentNodes.contains(n)) { for (unsigned i = groupEnd; i < to; ++i) { if (parentWithDepth(commonAncestorDepth + 1, parentMatrix[i]) == n) parentMatrix[i].swap(parentMatrix[groupEnd++]); } if (groupEnd - previousGroupEnd > 1) sortBlock(previousGroupEnd, groupEnd, parentMatrix, mayContainAttributeNodes); DCHECK_NE(previousGroupEnd, groupEnd); previousGroupEnd = groupEnd;#if DCHECK_IS_ON() parentNodes.remove(n);#endif } } DCHECK(parentNodes.isEmpty());}
开发者ID:mirror,项目名称:chromium,代码行数:100,
示例15: DCHECKTypedValue TypedValue::ReconstructFromProto(const serialization::TypedValue &proto) { DCHECK(ProtoIsValid(proto)) << "Attempted to create TypedValue from an invalid proto description:/n" << proto.DebugString(); switch (proto.type_id()) { case serialization::Type::INT: return proto.has_int_value() ? TypedValue(static_cast<int>(proto.int_value())) : TypedValue(kInt); case serialization::Type::LONG: return proto.has_long_value() ? TypedValue(static_cast<std::int64_t>(proto.long_value())) : TypedValue(kLong); case serialization::Type::FLOAT: return proto.has_float_value() ? TypedValue(static_cast<float>(proto.float_value())) : TypedValue(kFloat); case serialization::Type::DOUBLE: return proto.has_double_value() ? TypedValue(static_cast<double>(proto.double_value())) : TypedValue(kDouble); case serialization::Type::DATETIME: if (proto.has_datetime_value()) { DatetimeLit datetime; datetime.ticks = proto.datetime_value(); return TypedValue(datetime); } else { return TypedValue(kDatetime); } case serialization::Type::DATETIME_INTERVAL: if (proto.has_datetime_interval_value()) { DatetimeIntervalLit interval; interval.interval_ticks = proto.datetime_interval_value(); return TypedValue(interval); } else { return TypedValue(kDatetimeInterval); } case serialization::Type::YEAR_MONTH_INTERVAL: if (proto.has_year_month_interval_value()) { YearMonthIntervalLit interval; interval.months = proto.year_month_interval_value(); return TypedValue(interval); } else { return TypedValue(kYearMonthInterval); } case serialization::Type::CHAR: return proto.has_out_of_line_data() ? TypedValue(kChar, static_cast<const void*>(proto.out_of_line_data().c_str()), proto.out_of_line_data().size()).ensureNotReference() : TypedValue(kChar); case serialization::Type::VAR_CHAR: return proto.has_out_of_line_data() ? TypedValue(kVarChar, static_cast<const void*>(proto.out_of_line_data().c_str()), proto.out_of_line_data().size()).ensureNotReference() : TypedValue(kVarChar); case serialization::Type::NULL_TYPE: return TypedValue(kNullType); default: FATAL_ERROR("Unrecognized TypeID in TypedValue::ReconstructFromProto"); }}
开发者ID:HanumathRao,项目名称:incubator-quickstep,代码行数:64,
示例16: switchserialization::TypedValue TypedValue::getProto() const { serialization::TypedValue proto; // NOTE(chasseur): To represent a NULL value, only the 'type_id' field of the // proto is filled in, and all the optional value fields are omitted. switch (getTypeID()) { case kInt: proto.set_type_id(serialization::Type::INT); if (!isNull()) { proto.set_int_value(getLiteral<int>()); } break; case kLong: proto.set_type_id(serialization::Type::LONG); if (!isNull()) { proto.set_long_value(getLiteral<std::int64_t>()); } break; case kFloat: proto.set_type_id(serialization::Type::FLOAT); if (!isNull()) { proto.set_float_value(getLiteral<float>()); } break; case kDouble: proto.set_type_id(serialization::Type::DOUBLE); if (!isNull()) { proto.set_double_value(getLiteral<double>()); } break; case kDatetime: proto.set_type_id(serialization::Type::DATETIME); if (!isNull()) { proto.set_datetime_value(value_union_.datetime_value.ticks); } break; case kDatetimeInterval: proto.set_type_id(serialization::Type::DATETIME_INTERVAL); if (!isNull()) { proto.set_datetime_interval_value(value_union_.datetime_interval_value.interval_ticks); } break; case kYearMonthInterval: proto.set_type_id(serialization::Type::YEAR_MONTH_INTERVAL); if (!isNull()) { proto.set_year_month_interval_value(value_union_.year_month_interval_value.months); } break; case kChar: proto.set_type_id(serialization::Type::CHAR); if (!isNull()) { proto.set_out_of_line_data(static_cast<const char*>(getOutOfLineData()), getDataSize()); } break; case kVarChar: proto.set_type_id(serialization::Type::VAR_CHAR); if (!isNull()) { proto.set_out_of_line_data(static_cast<const char*>(getOutOfLineData()), getDataSize()); } break; case kNullType: proto.set_type_id(serialization::Type::NULL_TYPE); DCHECK(isNull()); break; default: FATAL_ERROR("Unrecognized TypeID in TypedValue::getProto"); } return proto;}
开发者ID:HanumathRao,项目名称:incubator-quickstep,代码行数:70,
示例17: pixelSnappedIntRect//.........这里部分代码省略......... IntRect paintRect = backgroundRect; if (!rootObject || !rootObject->isBox()) { backgroundRenderable = false; } else if (rootObject->hasLayer()) { const PaintLayer& rootLayer = *toLayoutBoxModelObject(rootObject)->layer(); LayoutPoint offset; rootLayer.convertToLayerCoords(nullptr, offset); transform.translate(offset.x(), offset.y()); transform.multiply( rootLayer.renderableTransform(paintInfo.getGlobalPaintFlags())); if (!transform.isInvertible()) { backgroundRenderable = false; } else { bool isClamped; paintRect = transform.inverse() .projectQuad(FloatQuad(backgroundRect), &isClamped) .enclosingBoundingBox(); backgroundRenderable = !isClamped; } } if (!backgroundRenderable) { if (baseBackgroundColor.alpha()) { context.fillRect( backgroundRect, baseBackgroundColor, shouldClearCanvas ? SkBlendMode::kSrc : SkBlendMode::kSrcOver); } else if (shouldClearCanvas) { context.fillRect(backgroundRect, Color(), SkBlendMode::kClear); } return; } BoxPainter::FillLayerOcclusionOutputList reversedPaintList; bool shouldDrawBackgroundInSeparateBuffer = BoxPainter(m_layoutView) .calculateFillLayerOcclusionCulling( reversedPaintList, m_layoutView.style()->backgroundLayers()); DCHECK(reversedPaintList.size()); // If the root background color is opaque, isolation group can be skipped // because the canvas // will be cleared by root background color. if (!rootBackgroundColor.hasAlpha()) shouldDrawBackgroundInSeparateBuffer = false; // We are going to clear the canvas with transparent pixels, isolation group // can be skipped. if (!baseBackgroundColor.alpha() && shouldClearCanvas) shouldDrawBackgroundInSeparateBuffer = false; if (shouldDrawBackgroundInSeparateBuffer) { if (baseBackgroundColor.alpha()) { context.fillRect( backgroundRect, baseBackgroundColor, shouldClearCanvas ? SkBlendMode::kSrc : SkBlendMode::kSrcOver); } context.beginLayer(); } Color combinedBackgroundColor = shouldDrawBackgroundInSeparateBuffer ? rootBackgroundColor : baseBackgroundColor.blend(rootBackgroundColor); if (combinedBackgroundColor.alpha()) { if (!combinedBackgroundColor.hasAlpha() && RuntimeEnabledFeatures::slimmingPaintV2Enabled()) recorder.setKnownToBeOpaque(); context.fillRect(backgroundRect, combinedBackgroundColor, (shouldDrawBackgroundInSeparateBuffer || shouldClearCanvas) ? SkBlendMode::kSrc : SkBlendMode::kSrcOver); } else if (shouldClearCanvas && !shouldDrawBackgroundInSeparateBuffer) { context.fillRect(backgroundRect, Color(), SkBlendMode::kClear); } for (auto it = reversedPaintList.rbegin(); it != reversedPaintList.rend(); ++it) { DCHECK((*it)->clip() == BorderFillBox); bool shouldPaintInViewportSpace = (*it)->attachment() == FixedBackgroundAttachment; if (shouldPaintInViewportSpace) { BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, LayoutRect(LayoutRect::infiniteIntRect()), BackgroundBleedNone); } else { context.save(); // TODO(trchen): We should be able to handle 3D-transformed root // background with slimming paint by using transform display items. context.concatCTM(transform.toAffineTransform()); BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone); context.restore(); } } if (shouldDrawBackgroundInSeparateBuffer) context.endLayer();}
开发者ID:mirror,项目名称:chromium,代码行数:101,
示例18: DCHECKvoid BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) { DCHECK(!m_layoutBlock.childrenInline()); PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);}
开发者ID:mirror,项目名称:chromium,代码行数:6,
示例19: appendNullValue /** * @brief Append a NULL value to this NativeColumnVector. * @warning Appending a new value must not cause the number of values in this * NativeColumnVector to exceed the reserved length supplied to the * constructor. **/ inline void appendNullValue() { DCHECK_LT(actual_length_, reserved_length_); DCHECK(null_bitmap_); null_bitmap_->setBit(actual_length_, true); ++actual_length_; }
开发者ID:apache,项目名称:incubator-quickstep,代码行数:12,
注:本文中的DCHECK函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DCHECK_EQ函数代码示例 C++ DCFlushRange函数代码示例 |