IntRect Surface::computePrepareArea() { IntRect area; if (!getFirstLayer()->contentIsScrollable() && !isBase() && getFirstLayer()->state()->layersRenderingMode() == GLWebViewState::kAllTextures) { area = fullContentArea(); double total = ((double) area.width()) * ((double) area.height()); if (total > MAX_FULL_CONTENT_AREA) area = visibleContentArea(); /// M: Willy, limit the max number of tile is 64. @{ else { float scale = getFirstLayer()->state()->scale(); int x = ((double)area.width() * scale) / TilesManager::tileWidth(); int y = ((double)area.height() * scale) / TilesManager::tileHeight(); if ((x * y) > 64) { IntRect a = visibleContentArea(); IntRect tmpArea = a; tmpArea.inflateX(TilesManager::tileWidth() << 1); tmpArea.inflateY(TilesManager::tileHeight() << 1); tmpArea.intersect(area); area = tmpArea; } } /// @} } else area = visibleContentArea(); return area; }
IntRect Surface::computePrepareArea() { IntRect area; if (!getFirstLayer()->contentIsScrollable() && !isBase() && getFirstLayer()->state()->layersRenderingMode() == GLWebViewState::kAllTextures) { area = fullContentArea(); double total = ((double) area.width()) * ((double) area.height()); if (total > MAX_FULL_CONTENT_AREA) area = visibleContentArea(); } else area = visibleContentArea(); return area; }
IntRect Surface::computePrepareArea() { IntRect area; if (!getFirstLayer()->contentIsScrollable() && !isBase() && getFirstLayer()->state()->layersRenderingMode() == GLWebViewState::kAllTextures) { area = fullContentArea(); double total = ((double) area.width()) * ((double) area.height()); // CAPP_WEB_PREPARE_VISIBLE_AREA if (total > MAX_FULL_CONTENT_AREA|| m_drawTransform.isIdentityOrTranslation()) area = visibleContentArea(); } else area = visibleContentArea(); return area; }
void Surface::computeTexturesAmount(TexturesResult* result) { if (!m_surfaceBacking || isBase()) return; LayerAndroid* layer = 0; if (singleLayer()) layer = getFirstLayer(); m_surfaceBacking->computeTexturesAmount(result, visibleContentArea(), fullContentArea(), layer); }
bool Surface::drawGL(bool layerTilesDisabled) { bool tilesDisabled = layerTilesDisabled && !isBase(); // SAMSUNG CHANGE ++ : google handwriting 'g' icon display issue, Youtube.com 356x2 height line display issue // This patch should be applied with DEV CL 56175 // WAS:if (singleLayer() && !getFirstLayer()->visible()) if (singleLayer() && (!getFirstLayer()->visible() || getFirstLayer()->drawOpacity() <= 0.0f)) return false; //SAMSUNG CHANGE -- if (!isBase()) { FloatRect drawClip = getFirstLayer()->drawClip(); if (!singleLayer()) { for (unsigned int i = 1; i < m_layers.size(); i++) drawClip.unite(m_layers[i]->drawClip()); } FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(drawClip); TilesManager::instance()->shader()->clip(clippingRect); } bool askRedraw = false; if (m_surfaceBacking && !tilesDisabled) { ALOGV("drawGL on Surf %p with SurfBack %p, first layer %s (%d)", this, m_surfaceBacking, getFirstLayer()->subclassName().ascii().data(), getFirstLayer()->uniqueId()); bool force3dContentVisible = true; IntRect drawArea = visibleContentArea(force3dContentVisible); m_surfaceBacking->drawGL(drawArea, opacity(), drawTransform(), useAggressiveRendering(), background()); } // draw member layers (draws image textures, glextras) for (unsigned int i = 0; i < m_layers.size(); i++) { if (m_layers[i]->drawGL(tilesDisabled)) { m_layers[i]->addDirtyArea(); askRedraw = true; } } return askRedraw; }
void LayerAndroid::showLayer(int indent) { char spaces[256]; memset(spaces, 0, 256); for (int i = 0; i < indent; i++) spaces[i] = ' '; if (!indent) { ALOGD("\n\n--- LAYERS TREE ---"); IntRect contentViewport(TilesManager::instance()->shader()->contentViewport()); ALOGD("contentViewport(%d, %d, %d, %d)", contentViewport.x(), contentViewport.y(), contentViewport.width(), contentViewport.height()); } IntRect r(0, 0, getWidth(), getHeight()); IntRect tr = m_drawTransform.mapRect(r); IntRect visible = visibleContentArea(); IntRect clip(m_clippingRect.x(), m_clippingRect.y(), m_clippingRect.width(), m_clippingRect.height()); ALOGD("%s s:%x %s %s (%d) [%d:%x - 0x%x] - %s %s - area (%d, %d, %d, %d) - visible (%d, %d, %d, %d) " "clip (%d, %d, %d, %d) %s %s m_content(%x), pic w: %d h: %d originalLayer: %x %d", spaces, m_surface, m_haveClip ? "CLIP LAYER" : "", subclassName().ascii().data(), subclassType(), uniqueId(), this, m_owningLayer, needsTexture() ? "needsTexture" : "", m_imageCRC ? "hasImage" : "", tr.x(), tr.y(), tr.width(), tr.height(), visible.x(), visible.y(), visible.width(), visible.height(), clip.x(), clip.y(), clip.width(), clip.height(), contentIsScrollable() ? "SCROLLABLE" : "", isPositionFixed() ? "FIXED" : "", m_content, m_content ? m_content->width() : -1, m_content ? m_content->height() : -1, m_originalLayer, m_originalLayer ? m_originalLayer->uniqueId() : -1); int count = this->countChildren(); for (int i = 0; i < count; i++) this->getChild(i)->showLayer(indent + 2); }
bool Surface::drawGL(bool layerTilesDisabled) { bool tilesDisabled = layerTilesDisabled && !isBase(); if (singleLayer() && !getFirstLayer()->visible()) return false; if (!isBase()) { FloatRect drawClip = getFirstLayer()->drawClip(); if (!singleLayer()) { for (unsigned int i = 1; i < m_layers.size(); i++) drawClip.unite(m_layers[i]->drawClip()); } FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(drawClip); TilesManager::instance()->shader()->clip(clippingRect); } bool askRedraw = false; if (m_surfaceBacking && !tilesDisabled) { ALOGV("drawGL on Surf %p with SurfBack %p, first layer %s (%d)", this, m_surfaceBacking, getFirstLayer()->subclassName(), getFirstLayer()->uniqueId()); bool force3dContentVisible = true; IntRect drawArea = visibleContentArea(force3dContentVisible); m_surfaceBacking->drawGL(drawArea, opacity(), drawTransform(), useAggressiveRendering(), background()); } // draw member layers (draws image textures, glextras) for (unsigned int i = 0; i < m_layers.size(); i++) { if (m_layers[i]->drawGL(tilesDisabled)) { m_layers[i]->addDirtyArea(); askRedraw = true; } } return askRedraw; }