aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrLayerHoister.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-11-10 08:10:42 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-10 08:10:42 -0800
commita63f32e879a67c84f820c32ac2b10ffd7b2940b8 (patch)
tree20bc957d064ba229cb36a58dbc5993d4246f59c2 /src/gpu/GrLayerHoister.cpp
parent39fa278c40db07bdcd5a9c8e88b9cfbeefc43e5b (diff)
Address MSAA rendering in layer hoisting
This became relevant whilst attempting to rebaseline the multipicturedraw GMs after turning on layer hoisting inside Skia. Review URL: https://codereview.chromium.org/709943003
Diffstat (limited to 'src/gpu/GrLayerHoister.cpp')
-rw-r--r--src/gpu/GrLayerHoister.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 5d3a383b47..c74913d757 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -22,7 +22,8 @@ static void prepare_for_hoisting(GrLayerCache* layerCache,
const SkIRect& layerRect,
SkTDArray<GrHoistedLayer>* needRendering,
SkTDArray<GrHoistedLayer>* recycled,
- bool attemptToAtlas) {
+ bool attemptToAtlas,
+ int numSamples) {
const SkPicture* pict = info.fPicture ? info.fPicture : topLevelPicture;
SkMatrix combined = SkMatrix::Concat(info.fPreMat, info.fLocalMat);
@@ -38,7 +39,7 @@ static void prepare_for_hoisting(GrLayerCache* layerCache,
desc.fWidth = layerRect.width();
desc.fHeight = layerRect.height();
desc.fConfig = kSkia8888_GrPixelConfig;
- // TODO: need to deal with sample count
+ desc.fSampleCnt = numSamples;
bool locked, needsRendering;
if (attemptToAtlas) {
@@ -81,7 +82,13 @@ void GrLayerHoister::FindLayersToAtlas(GrContext* context,
const SkPicture* topLevelPicture,
const SkRect& query,
SkTDArray<GrHoistedLayer>* atlased,
- SkTDArray<GrHoistedLayer>* recycled) {
+ SkTDArray<GrHoistedLayer>* recycled,
+ int numSamples) {
+ if (0 != numSamples) {
+ // MSAA layers are currently never atlased
+ return;
+ }
+
GrLayerCache* layerCache = context->getLayerCache();
layerCache->processDeletedPictures();
@@ -123,7 +130,7 @@ void GrLayerHoister::FindLayersToAtlas(GrContext* context,
continue;
}
- prepare_for_hoisting(layerCache, topLevelPicture, info, ir, atlased, recycled, true);
+ prepare_for_hoisting(layerCache, topLevelPicture, info, ir, atlased, recycled, true, 0);
}
}
@@ -132,7 +139,8 @@ void GrLayerHoister::FindLayersToHoist(GrContext* context,
const SkPicture* topLevelPicture,
const SkRect& query,
SkTDArray<GrHoistedLayer>* needRendering,
- SkTDArray<GrHoistedLayer>* recycled) {
+ SkTDArray<GrHoistedLayer>* recycled,
+ int numSamples) {
GrLayerCache* layerCache = context->getLayerCache();
layerCache->processDeletedPictures();
@@ -166,7 +174,7 @@ void GrLayerHoister::FindLayersToHoist(GrContext* context,
layerRect.roundOut(&ir);
prepare_for_hoisting(layerCache, topLevelPicture, info, ir,
- needRendering, recycled, false);
+ needRendering, recycled, false, numSamples);
}
}