| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; | 658 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; |
| 659 desc.fSampleCnt = 0; | 659 desc.fSampleCnt = 0; |
| 660 desc.fWidth = source.width(); | 660 desc.fWidth = source.width(); |
| 661 desc.fHeight = source.height(); | 661 desc.fHeight = source.height(); |
| 662 desc.fConfig = kSkia8888_GrPixelConfig; | 662 desc.fConfig = kSkia8888_GrPixelConfig; |
| 663 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 663 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
| 664 GrAutoScratchTexture scratch_texture( | 664 GrAutoScratchTexture scratch_texture( |
| 665 use_gr_context->context(), desc, GrContext::kExact_ScratchTexMatch); | 665 use_gr_context->context(), desc, GrContext::kExact_ScratchTexMatch); |
| 666 skia::RefPtr<GrTexture> backing_store = | 666 skia::RefPtr<GrTexture> backing_store = |
| 667 skia::AdoptRef(scratch_texture.detach()); | 667 skia::AdoptRef(scratch_texture.detach()); |
| 668 if (backing_store.get() == NULL) |
| 669 return SkBitmap(); |
| 668 | 670 |
| 669 // Create a device and canvas using that backing store. | 671 // Create a device and canvas using that backing store. |
| 670 SkGpuDevice device(use_gr_context->context(), backing_store.get()); | 672 SkGpuDevice device(use_gr_context->context(), backing_store.get()); |
| 671 SkCanvas canvas(&device); | 673 SkCanvas canvas(&device); |
| 672 | 674 |
| 673 // Draw the source bitmap through the filter to the canvas. | 675 // Draw the source bitmap through the filter to the canvas. |
| 674 SkPaint paint; | 676 SkPaint paint; |
| 675 paint.setImageFilter(filter); | 677 paint.setImageFilter(filter); |
| 676 canvas.clear(SK_ColorTRANSPARENT); | 678 canvas.clear(SK_ColorTRANSPARENT); |
| 677 | 679 |
| (...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 context_support_->ScheduleOverlayPlane( | 3176 context_support_->ScheduleOverlayPlane( |
| 3175 overlay.plane_z_order, | 3177 overlay.plane_z_order, |
| 3176 overlay.transform, | 3178 overlay.transform, |
| 3177 pending_overlay_resources_.back()->texture_id(), | 3179 pending_overlay_resources_.back()->texture_id(), |
| 3178 overlay.display_rect, | 3180 overlay.display_rect, |
| 3179 overlay.uv_rect); | 3181 overlay.uv_rect); |
| 3180 } | 3182 } |
| 3181 } | 3183 } |
| 3182 | 3184 |
| 3183 } // namespace cc | 3185 } // namespace cc |
| OLD | NEW |