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

Issue 508873004: Revert of Convert BBH APIs to use SkRect. (Closed)

Created:
6 years, 3 months ago by mtklein
Modified:
6 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Revert of Convert BBH APIs to use SkRect. (patchset #9 of https://codereview.chromium.org/511613002/) Reason for revert: test RecordDraw_BBH: ../../tests/RecordDrawTest.cpp:140 bbh.entries[i].bounds == SkRect::MakeWH(400, 480) Mac 10.8 Release Original issue's description: > Convert BBH APIs to use SkRect. > > Still TODO: convert internals of SkTileGrid.cpp and SkRTree.cpp to work in floats too. > > NOTREECHECKS=true > > BUG=skia:1021 > > Committed: https://skia.googlesource.com/skia/+/533eb782edaa0b6fece6166d3001edf72ec39f11 TBR=robertphillips@google.com,reed@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia:1021

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -226 lines) Patch
M bench/RTreeBench.cpp View 3 chunks +46 lines, -46 lines 0 comments Download
M include/core/SkPicture.h View 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/SkGpuDevice.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkBBoxHierarchy.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkBBoxHierarchyRecord.cpp View 1 chunk +3 lines, -1 line 0 comments Download
M src/core/SkPicture.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPictureData.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPictureData.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPicturePlayback.cpp View 3 chunks +11 lines, -8 lines 0 comments Download
M src/core/SkRTree.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkRTree.cpp View 2 chunks +2 lines, -11 lines 0 comments Download
M src/core/SkRecordDraw.cpp View 15 chunks +59 lines, -57 lines 0 comments Download
M src/core/SkTileGrid.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkTileGrid.cpp View 2 chunks +9 lines, -12 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 11 chunks +27 lines, -26 lines 0 comments Download
M tests/BBoxHierarchyTest.cpp View 3 chunks +11 lines, -14 lines 0 comments Download
M tests/PictureTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/RTreeTest.cpp View 3 chunks +10 lines, -14 lines 0 comments Download
M tests/RecordDrawTest.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M tests/TileGridTest.cpp View 2 chunks +20 lines, -20 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
mtklein
Created Revert of Convert BBH APIs to use SkRect.
6 years, 3 months ago (2014-08-27 18:59:48 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@google.com/508873004/1
6 years, 3 months ago (2014-08-27 19:00:11 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 3 months ago (2014-08-27 19:00:18 UTC) #3
commit-bot: I haz the power
6 years, 3 months ago (2014-08-27 19:00:19 UTC) #4
Failed to apply patch for src/gpu/SkGpuDevice.cpp:
While running git apply --index -p1;
  <stdin>:11: trailing whitespace.
      
  <stdin>:20: trailing whitespace.
          
  <stdin>:23: trailing whitespace.
          
  <stdin>:28: trailing whitespace.
          
  <stdin>:37: trailing whitespace.
          
  error: patch failed: src/gpu/SkGpuDevice.cpp:2004
  error: src/gpu/SkGpuDevice.cpp: patch does not apply

Patch:       src/gpu/SkGpuDevice.cpp
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index
61ae5ce829ea6c6f5a57b444be31e1d1e84bd50a..693e16c0e320d13ad9889320f947c7b9f11ed8bf
100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1617,7 +1617,7 @@
     CHECK_SHOULD_DRAW(draw, false);
 
     GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawVertices", fContext);
-
+    
     const uint16_t* outIndices;
     SkAutoTDeleteArray<uint16_t> outAlloc(NULL);
     GrPrimitiveType primType;
@@ -1625,13 +1625,13 @@
 
     // If both textures and vertex-colors are NULL, strokes hairlines with the
paint's color.
     if ((NULL == texs || NULL == paint.getShader()) && NULL == colors) {
-
+        
         texs = NULL;
-
+        
         SkPaint copy(paint);
         copy.setStyle(SkPaint::kStroke_Style);
         copy.setStrokeWidth(0);
-
+        
         // we ignore the shader if texs is null.
         SkPaint2GrPaintNoShader(this->context(), copy,
SkColor2GrColor(copy.getColor()),
                                 NULL == colors, &grPaint);
@@ -1648,13 +1648,13 @@
                 triangleCount = n - 2;
                 break;
         }
-
+        
         VertState       state(vertexCount, indices, indexCount);
         VertState::Proc vertProc = state.chooseProc(vmode);
-
+        
         //number of indices for lines per triangle with kLines
         indexCount = triangleCount * 6;
-
+        
         outAlloc.reset(SkNEW_ARRAY(uint16_t, indexCount));
         outIndices = outAlloc.get();
         uint16_t* auxIndices = outAlloc.get();
@@ -1671,7 +1671,7 @@
     } else {
         outIndices = indices;
         primType = gVertexMode2PrimitiveType[vmode];
-
+        
         if (NULL == texs || NULL == paint.getShader()) {
             SkPaint2GrPaintNoShader(this->context(), paint,
SkColor2GrColor(paint.getColor()),
                                     NULL == colors, &grPaint);
@@ -1879,7 +1879,7 @@
 // Return true if any layers are suitable for hoisting
 bool SkGpuDevice::FindLayersToHoist(const GrAccelData *gpuData,
                                     const SkPicture::OperationList* ops,
-                                    const SkRect& query,
+                                    const SkIRect& query,
                                     bool* pullForward) {
     bool anyHoisted = false;
 
@@ -1929,12 +1929,12 @@
         for (int j = 0; j < gpuData->numSaveLayers(); ++j) {
             const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
 
-            SkRect layerRect = SkRect::MakeXYWH(SkIntToScalar(info.fOffset.fX),
-                                                SkIntToScalar(info.fOffset.fY),
-                                               
SkIntToScalar(info.fSize.fWidth),
-                                               
SkIntToScalar(info.fSize.fHeight));
-
-            if (!SkRect::Intersects(query, layerRect)) {
+            SkIRect layerRect = SkIRect::MakeXYWH(info.fOffset.fX,
+                                                  info.fOffset.fY,
+                                                  info.fSize.fWidth,
+                                                  info.fSize.fHeight);
+
+            if (!SkIRect::Intersects(query, layerRect)) {
                 continue;
             }
 
@@ -1986,11 +1986,12 @@
     if (!mainCanvas->getClipBounds(&clipBounds)) {
         return true;
     }
-
-    SkAutoTDelete<const SkPicture::OperationList> ops(
-            picture->EXPERIMENTAL_getActiveOps(clipBounds));
-
-    if (!FindLayersToHoist(gpuData, ops.get(), clipBounds, pullForward.get()))
{
+    SkIRect query;
+    clipBounds.roundOut(&query);
+
+    SkAutoTDelete<const SkPicture::OperationList>
ops(picture->EXPERIMENTAL_getActiveOps(query));
+
+    if (!FindLayersToHoist(gpuData, ops.get(), query, pullForward.get())) {
         return false;
     }
 
@@ -2004,9 +2005,9 @@
         if (pullForward[i]) {
             const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i);
 
-            GrCachedLayer* layer =
fContext->getLayerCache()->findLayerOrCreate(picture->uniqueID(),
-                                                                               
info.fSaveLayerOpID,
-                                                                               
info.fRestoreOpID,
+            GrCachedLayer* layer =
fContext->getLayerCache()->findLayerOrCreate(picture->uniqueID(), 
+                                                                               
info.fSaveLayerOpID, 
+                                                                               
info.fRestoreOpID, 
                                                                                
info.fCTM);
 
            
SkPictureReplacementPlayback::PlaybackReplacements::ReplacementInfo* layerInfo =
@@ -2029,7 +2030,7 @@
             }
 
             layerInfo->fBM = SkNEW(SkBitmap);  // fBM is allocated so
ReplacementInfo can be POD
-            wrap_texture(layer->texture(),
+            wrap_texture(layer->texture(), 
                          !layer->isAtlased() ? desc.fWidth :
layer->texture()->width(),
                          !layer->isAtlased() ? desc.fHeight :
layer->texture()->height(),
                          layerInfo->fBM);
@@ -2065,7 +2066,7 @@
 }
 
 void SkGpuDevice::drawLayers(const SkPicture* picture,
-                             const SkTDArray<GrCachedLayer*>& atlased,
+                             const SkTDArray<GrCachedLayer*>& atlased, 
                              const SkTDArray<GrCachedLayer*>& nonAtlased) {
     // Render the atlased layers that require it
     if (atlased.count() > 0) {
@@ -2170,7 +2171,7 @@
     }
 
 #if DISABLE_CACHING
-    // This code completely clears out the atlas. It is required when
+    // This code completely clears out the atlas. It is required when 
     // caching is disabled so the atlas doesn't fill up and force more
     // free floating layers
     fContext->getLayerCache()->purge(picture->uniqueID());

Powered by Google App Engine
This is Rietveld 408576698