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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 backend_texture_description)); | 641 backend_texture_description)); |
642 | 642 |
643 SkImageInfo info = { | 643 SkImageInfo info = { |
644 source_texture_resource->size().width(), | 644 source_texture_resource->size().width(), |
645 source_texture_resource->size().height(), | 645 source_texture_resource->size().height(), |
646 kPMColor_SkColorType, | 646 kPMColor_SkColorType, |
647 kPremul_SkAlphaType | 647 kPremul_SkAlphaType |
648 }; | 648 }; |
649 // Place the platform texture inside an SkBitmap. | 649 // Place the platform texture inside an SkBitmap. |
650 SkBitmap source; | 650 SkBitmap source; |
651 source.setConfig(info); | 651 source.setInfo(info); |
652 skia::RefPtr<SkGrPixelRef> pixel_ref = | 652 skia::RefPtr<SkGrPixelRef> pixel_ref = |
653 skia::AdoptRef(new SkGrPixelRef(info, texture.get())); | 653 skia::AdoptRef(new SkGrPixelRef(info, texture.get())); |
654 source.setPixelRef(pixel_ref.get()); | 654 source.setPixelRef(pixel_ref.get()); |
655 | 655 |
656 // Create a scratch texture for backing store. | 656 // Create a scratch texture for backing store. |
657 GrTextureDesc desc; | 657 GrTextureDesc desc; |
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(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 backend_texture_description)); | 745 backend_texture_description)); |
746 | 746 |
747 SkImageInfo source_info = { | 747 SkImageInfo source_info = { |
748 source_size.width(), | 748 source_size.width(), |
749 source_size.height(), | 749 source_size.height(), |
750 kPMColor_SkColorType, | 750 kPMColor_SkColorType, |
751 kPremul_SkAlphaType | 751 kPremul_SkAlphaType |
752 }; | 752 }; |
753 // Place the platform texture inside an SkBitmap. | 753 // Place the platform texture inside an SkBitmap. |
754 SkBitmap source; | 754 SkBitmap source; |
755 source.setConfig(source_info); | 755 source.setInfo(source_info); |
756 skia::RefPtr<SkGrPixelRef> source_pixel_ref = | 756 skia::RefPtr<SkGrPixelRef> source_pixel_ref = |
757 skia::AdoptRef(new SkGrPixelRef(source_info, source_texture.get())); | 757 skia::AdoptRef(new SkGrPixelRef(source_info, source_texture.get())); |
758 source.setPixelRef(source_pixel_ref.get()); | 758 source.setPixelRef(source_pixel_ref.get()); |
759 | 759 |
760 SkImageInfo background_info = { | 760 SkImageInfo background_info = { |
761 background_size.width(), | 761 background_size.width(), |
762 background_size.height(), | 762 background_size.height(), |
763 kPMColor_SkColorType, | 763 kPMColor_SkColorType, |
764 kPremul_SkAlphaType | 764 kPremul_SkAlphaType |
765 }; | 765 }; |
766 | 766 |
767 SkBitmap background; | 767 SkBitmap background; |
768 background.setConfig(background_info); | 768 background.setInfo(background_info); |
769 skia::RefPtr<SkGrPixelRef> background_pixel_ref = | 769 skia::RefPtr<SkGrPixelRef> background_pixel_ref = |
770 skia::AdoptRef(new SkGrPixelRef( | 770 skia::AdoptRef(new SkGrPixelRef( |
771 background_info, background_texture.get())); | 771 background_info, background_texture.get())); |
772 background.setPixelRef(background_pixel_ref.get()); | 772 background.setPixelRef(background_pixel_ref.get()); |
773 | 773 |
774 // Create a scratch texture for backing store. | 774 // Create a scratch texture for backing store. |
775 GrTextureDesc desc; | 775 GrTextureDesc desc; |
776 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; | 776 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; |
777 desc.fSampleCnt = 0; | 777 desc.fSampleCnt = 0; |
778 desc.fWidth = source.width(); | 778 desc.fWidth = source.width(); |
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3174 context_support_->ScheduleOverlayPlane( | 3174 context_support_->ScheduleOverlayPlane( |
3175 overlay.plane_z_order, | 3175 overlay.plane_z_order, |
3176 overlay.transform, | 3176 overlay.transform, |
3177 pending_overlay_resources_.back()->texture_id(), | 3177 pending_overlay_resources_.back()->texture_id(), |
3178 overlay.display_rect, | 3178 overlay.display_rect, |
3179 overlay.uv_rect); | 3179 overlay.uv_rect); |
3180 } | 3180 } |
3181 } | 3181 } |
3182 | 3182 |
3183 } // namespace cc | 3183 } // namespace cc |
OLD | NEW |