OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 static void paintArtifactToWebDisplayItemList(WebDisplayItemList* list, const Pa
intArtifact& artifact, const gfx::Rect& bounds) | 52 static void paintArtifactToWebDisplayItemList(WebDisplayItemList* list, const Pa
intArtifact& artifact, const gfx::Rect& bounds) |
53 { | 53 { |
54 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 54 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
55 // This is a temporary path to paint the artifact using the paint chunk | 55 // This is a temporary path to paint the artifact using the paint chunk |
56 // properties. Ultimately, we should instead split the artifact into | 56 // properties. Ultimately, we should instead split the artifact into |
57 // separate layers and send those to the compositor, instead of sending | 57 // separate layers and send those to the compositor, instead of sending |
58 // one big flat SkPicture. | 58 // one big flat SkPicture. |
59 SkRect skBounds = SkRect::MakeXYWH(bounds.x(), bounds.y(), bounds.width(
), bounds.height()); | 59 SkRect skBounds = SkRect::MakeXYWH(bounds.x(), bounds.y(), bounds.width(
), bounds.height()); |
60 RefPtr<SkPicture> picture = paintArtifactToSkPicture(artifact, skBounds)
; | 60 list->appendDrawingItem(WebRect(bounds.x(), bounds.y(), bounds.width(),
bounds.height()), |
61 list->appendDrawingItem(WebRect(bounds.x(), bounds.y(), bounds.width(),
bounds.height()), picture.get()); | 61 paintArtifactToSkPicture(artifact, skBounds)); |
62 return; | 62 return; |
63 } | 63 } |
64 artifact.appendToWebDisplayItemList(list); | 64 artifact.appendToWebDisplayItemList(list); |
65 } | 65 } |
66 | 66 |
67 gfx::Rect ContentLayerDelegate::paintableRegion() | 67 gfx::Rect ContentLayerDelegate::paintableRegion() |
68 { | 68 { |
69 IntRect interestRect = m_graphicsLayer->interestRect(); | 69 IntRect interestRect = m_graphicsLayer->interestRect(); |
70 return gfx::Rect(interestRect.x(), interestRect.y(), interestRect.width(), i
nterestRect.height()); | 70 return gfx::Rect(interestRect.x(), interestRect.y(), interestRect.width(), i
nterestRect.height()); |
71 } | 71 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 paintController.setDisplayItemConstructionIsDisabled(false); | 104 paintController.setDisplayItemConstructionIsDisabled(false); |
105 paintController.setSubsequenceCachingIsDisabled(false); | 105 paintController.setSubsequenceCachingIsDisabled(false); |
106 } | 106 } |
107 | 107 |
108 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const | 108 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const |
109 { | 109 { |
110 return m_graphicsLayer->getPaintController().approximateUnsharedMemoryUsage(
); | 110 return m_graphicsLayer->getPaintController().approximateUnsharedMemoryUsage(
); |
111 } | 111 } |
112 | 112 |
113 } // namespace blink | 113 } // namespace blink |
OLD | NEW |